问题
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.
回答1:
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!
来源:https://stackoverflow.com/questions/23359095/how-to-put-cherrypy-wsgi-behind-nginx