Empty 'current url' for Django deployed with Nginx and fastcgi

前端 未结 1 1704
半阙折子戏
半阙折子戏 2021-01-03 10:59

When I query this url

http://mywebsite.com/foos/ 

Django give me :

Page not found (404)
Request Method:     GET
Request UR         


        
1条回答
  •  礼貌的吻别
    2021-01-03 11:29

    You are missing the PATH_INFO parameter.

    fastcgi_param PATH_INFO $fastcgi_script_name;
    

    See the nginx docs: http://wiki.nginx.org/DjangoFastCGI

    If you try "nginx PATH_INFO django" in your favourite search engine, it looks like some users had to remove the SCRIPT_NAME parameter as well to get it to work.

    0 讨论(0)
提交回复
热议问题