How to put Cherrypy wsgi behind Nginx?
Asked Answered
S

1

2

I was following by lalalalalalalambda example to put cherrypy behind nginx server, but didn't acomplish anything except nginx 502 bad gataway at my home Debian distro. Here is Nginx settings :

location / {
  include uwsgi_params;
  uwsgi_pass 127.0.0.1:8080;
}

Ofcourse there is IP instead of socket, but tried hard to make it work by following numerious of examples over the net. I'm hosting several domains with static html in production server, and trying to switch to python. I hope if I solve this issue, I will deploy my python app without any pain.

Sillabub answered 29/4, 2014 at 8:11 Comment(2)
Are you able to view the website when you go to the IP specified for uwsgi_pass?Yanirayank
Yes, directly on localhost:8080 it works beautiful.Sillabub
Y
2

I'm using uwsgi to run my cherrypy websites behind nginx and i'm using the following location config settings...

    location / {
     proxy_set_header    Host                $host;
     proxy_set_header    X-Real-IP           $remote_addr;
     proxy_set_header    X-Forwarded-For     $remote_addr;
     proxy_set_header    X-Originating-IP    $remote_addr;
     proxy_set_header    HTTP_REMOTE_ADDR    $remote_addr;
     proxy_set_header    REMOTE_ADDR         $remote_addr;
     proxy_set_header    CLIENT_IP           $remote_addr;
     proxy_pass http://0.0.0.0:8080/;
    }

Hope this helps!

Yanirayank answered 29/4, 2014 at 11:35 Comment(3)
what is your server_name set to?Yanirayank
In the first line of question is link to exact example in Cherrypy by lalalalalalalambda user. Please take a look...dunno is the server_name mandatory...bit confused.Sillabub
Yes...I was working around and it started successfully. Thanx huge.Sillabub

© 2022 - 2024 — McMap. All rights reserved.