我的阿里云服務(wù)器上本來搭了一個uwsgi+django的環(huán)境,用nginx代理,但是現(xiàn)在需要再搭一個tornado,用supervisor監(jiān)控,在nginx配置里分配了一個url,django為根url,現(xiàn)在情況是tornado的url都是404 not found
貼nginx的conf:
upstream bus-server {
server 127.0.0.1:8001;
server 127.0.0.1:8002;
server 127.0.0.1:8003;
server 127.0.0.1:8004;
}
server {
listen 80 default_server;
# listen [::]:80 default_server;
server_name _;
root /usr/share/nginx/html;
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
location /bus {
proxy_pass http://bus-server;
proxy_pass_header Server;
proxy_set_header Host $http_host;
proxy_redirect false;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
}
location /static {
alias /root/aqi/static;
}
location / {
include uwsgi_params;
uwsgi_pass 127.0.0.1:9090;
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}
求助大神幫忙解決一下?。?!感激不盡!
不能這樣設(shè)置,這樣 tornado 根本接收不到轉(zhuǎn)發(fā)過來的請求,你應(yīng)該把他們當(dāng)做兩個服務(wù)部署,通過域名區(qū)分,你可以參考我的這篇文章:如何使用 nginx 在一臺服務(wù)器部署多個網(wǎng)站