0

I'm setting up an nginx - python uwsgi server, I have encountered an an issue where i can get it to work when a port (8000) is supplied but when I use port 80, I just get a bad gateway (502) error

If i go the IP address of the machine, I get the nginx default homepage.

my ini file for my testapp is

    [uwsgi]
    module = testapp

    http-socket = :8000

    master = true
    processes = 5

    socket = /tmp/testapp.sock
    chmod-socket = 660
    vaccum = true

    die-on-term = true
The testapp file from sites-available    

    server {
        listen 80;
        server_name test.linuxtest.com;

        location / {
            include     uwsgi_params;
            uwsgi_pass  unix:/tmp/testapp.sock;

        }
    }

the testapp.py file that should be called.

def application(environ, start_response):
    start_response('200 OK', [('Content-Type', 'text/html')])
    return ["<h1 style='color:blue'>Hello There!</h1>"]

my netstat output for netstat -ltnp | grep 80 is

tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      864/nginx: master p
tcp        0      0 0.0.0.0:8000            0.0.0.0:*               LISTEN      1836/uwsgi

tcp6       0      0 :::80                   :::*                    LISTEN      864/nginx: master p

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.