Can nginx proxy uwsgi+django and supervisor+tornado at the same time?
我想大声告诉你
我想大声告诉你 2017-05-16 17:12:48
0
1
494

My Alibaba Cloud server originally had a uwsgi+django environment, using nginx proxy, but now I need to set up another tornado, monitor it with supervisor, and assign a url in the nginx configuration, with django as the root url. Now The situation is that the URLs of tornado are all 404 not found


Post 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 {
        }
    }

Ask the gods to help solve it! ! ! Grateful!

我想大声告诉你
我想大声告诉你

reply all(1)
黄舟

Cannot be set like this, so that tornado cannot receive the forwarded request at all. You should deploy them as two services, distinguished by domain names. You can refer to my article: How to use nginx to deploy multiple websites on one server

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!