简体   繁体   English

如何将Cherrypy wsgi放在Nginx之后?

[英]How to put Cherrypy wsgi behind Nginx?

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. 我遵循了lalalalalalalambda的示例 ,将Cherrypy放在了nginx服务器之后,但是除了我家Debian发行版上的nginx 502坏网关之外,没有完成任何事情。 Here is Nginx settings : 这是Nginx设置:

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. 当然,有IP代替套接字,但通过在网络上遵循大量示例来努力使IP起作用。 I'm hosting several domains with static html in production server, and trying to switch to python. 我在生产服务器中托管带有静态html的多个域,并尝试切换到python。 I hope if I solve this issue, I will deploy my python app without any pain. 我希望如果我解决了这个问题,那么我将轻松部署python应用程序。

I'm using uwsgi to run my cherrypy websites behind nginx and i'm using the following location config settings... 我正在使用uwsgi在nginx后面运行我的Cherrypy网站,并且正在使用以下位置配置设置...

    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! 希望这可以帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM