Python NGINX+;烧瓶+;UWSGI静态文件和权限
我的Python NGINX+;烧瓶+;UWSGI静态文件和权限,python,nginx,flask,uwsgi,Python,Nginx,Flask,Uwsgi,我的NGINX配置非常简单,如上所述 我知道您可以将以下内容添加到相同的配置中: location /static { root /var/www; } location /**<your-filename-here>** { alias **<absolute-path-to-file>**; } 然后NGINX将处理文件夹static/中的所有内容,但有时需要将其放在根目录www.example.com/robots.txtwww.example.com/f
NGINX
配置非常简单,如上所述
我知道您可以将以下内容添加到相同的配置中:
location /static {
root /var/www;
}
location /**<your-filename-here>** { alias **<absolute-path-to-file>**; }
然后NGINX
将处理文件夹static/
中的所有内容,但有时需要将其放在根目录www.example.com/robots.txt
www.example.com/favicon.ico
中。对于上述问题,什么是合适的解决方案?我刚从PHP
搬来,对构建一个基于Python
的平台非常不熟悉
而且,它似乎只有在我手动启动服务器时才起作用;
uwsgi-s/tmp/uwsgi.sock-w my_app:app--chown socket=www:www
在启动时,什么样的方式可以自动执行?希望这个问题足够清楚。对于几个单独的文件,您可以在nginx配置中执行以下操作:
location /static {
root /var/www;
}
location /**<your-filename-here>** { alias **<absolute-path-to-file>**; }