django 网站 centos nginx +uwsgi 环境要在根目录加个 txt 验证一下,有什么办法啊?
要在网站根目录 加一个 txt 文件,做验证。 但是 django 网站根目录是无法访问的。
有什么办法可以解决呢?
要在网站根目录 加一个 txt 文件,做验证。 但是 django 网站根目录是无法访问的。
有什么办法可以解决呢?
送个你,这个用来做一些验证,爽歪歪
# path for static files
root /path/to/app/current/public;
location / {
# checks for static file, if not found proxy to app
try_files $uri @proxy_to_app;
}
location @proxy_to_app {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
# we don’t want nginx trying to do something clever with
# redirects, we set the Host: header above already.
proxy_redirect off;
proxy_pass http://app_server;
}
目前用:
location ~ ^/MPxxxxxxxxxE.txt {
default_type text/html;
return 200 ‘pxxxxxxxxxE’;
}
可以了。
谢谢各位