Django and Nginx try_files 403 for site root page

本小妞迷上赌 提交于 2019-12-04 17:07:47

Add this

location = / { rewrite ^(.*)$ /index.htm last; }

underneath the root line to do a rewrite of the URI before further processing.

PS. You have probably sorted this out during the year since your asked, but here it is for other to see.

A better solution is you provide a / url in your urls.py is remove the

 root /var/www/$2/htdocs;

Then only include the root in location {} blocks where you serve up static assets.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!