首先,本来不想写这篇博客了,但是我测试了很多网上的例子包括简书的,全不行,我总结原因是自己太笨,搞了俩个晚上,后来决定,自己还是写一篇记录下来,保证自己以后使用

 环境:

  centos6.7 64

  python2.7.11

  pip 9.0.1

  nginx1.4.5

centos 6.7 搭建tornado + nginx + supervisor的方法(已经实践)

 

1.安装nginx

nginx安装方法

[root@pythonS1 ~]# vim /usr/local/nginx1.4.5/conf/nginx.conf
user nginx;
worker_processes 5;



events {
    worker_connections 1024;
    use epoll;
}

http{
upstream tornadoes {
    server 127.0.0.1:8000;
    server 127.0.0.1:8001;
    server 127.0.0.1:8002;
    server 127.0.0.1:8003;
}

server {
    listen 80;
    server_name localhost;

    location /static/ {
        root /var/www/static;
        if ($query_string) {
            expires max;
        }
    }

    location / {
        proxy_pass_header Server;
        proxy_set_header Host $http_host;
        proxy_redirect off;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Scheme $scheme;
        proxy_pass http://tornadoes;
        #proxy_pass http://www.iyunv.com/;
    }
}
}
View Code

相关文章:

  • 2022-12-23
  • 2021-10-12
  • 2022-12-23
  • 2022-02-03
  • 2021-07-04
  • 2021-08-27
  • 2022-02-02
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-20
  • 2022-12-23
  • 2021-09-22
  • 2021-07-20
相关资源
相似解决方案