The code in my template is this:
<a href="{{ url_for('.post',id=post.id) }}"><h2 >{{ post.title }}</h2></a>
My blog url is localhost:5000/index/all,It looks like(use app.run()):
The url for first post is localhost:5000/post/10
But if I use fcgi and nginx, it look like this:
The url for first post is localhost:5000/index/all/post/10 which not exist actually.
Why url_for() didn't return right url when I use nginx?
I also ask this question in Github.Thanks for miguelgrinberg's help,it's solved
FastCGI tends to have issues like this, where for odd reasons the CGI environment variables passed to the application are set incorrectly.
I add two line in manage.py and it works well in nginx.