Python中关于nginx+uwsgi+django环境搭建的问题求助
django+uwsgi linux 下环境
直接上配置
[uwsgi] set fileencodings=utf-8,gb2312,gb18030,gbk,ucs-bom,cp936,latin1 #project dic chdir=/usr/local/Yshoog/ #application module=Yshoog.wsgi:application #sock dic socket = /usr/local/script/uwsgi.sock #work num workers = 5 pidfile=/usr/local/script/uwsgi.pid #ip http=0.0.0.0:8000 #static static-map=/static=/usr/local/Yshoog/static #group uid=root gid=root #main queue master=true #remove unix socket vacuum=true #xuliehua thunder-locak=true
harakiri=30 #buffer post-buffering=4096 #log daemonize=/usr/local/script/uwsgi.log
Nginx 贴一部分
#Mobile Server
server {
listen 80;
server_name m.yshoog.com;
location /{
root m;
index index.html index.htm;
}
}
#PC Admin
server {
listen 80;
server_name admin.yshoog.com;
location /static/ {
root usr/local/Yshoog/static;
}
location / {
proxy_pass http://127.0.0.1:8000;
proxy_pass_header Server;
proxy_set_header Host $host:83;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
}
}
django 死活访问不到 static 文件 nginx 怎么匹配 url 都不行 求大神解解惑啊 一下午 快崩了
Python中关于nginx+uwsgi+django环境搭建的问题求助
admin.yshoog.com 这个到现在都没有反应 我先回家了 回家再看啊
我无法理解你的问题。
求大神解解惑啊
好,你先回家吧
这个贴和你的问题类似吗? https://www.v2ex.com/t/437768
这个改了也米什么用 错误信息是 nginx 404 not found 应该就是 /static/这个没有被转发到 /usr/local/Yshoog/static 这个路径下
本地启动 django 能访问到么
已解决 谢谢大家 直接转发了端口 实在是弄不懂这个 uwsi_params 的配置
直接转发到 8000 端口了 copy 的配置
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-Ip $remote_addr;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://127.0.0.1:8000/;
proxy_redirect off;


