www.cnblogs.com/ruiyqinrui

开源、架构、Linux C/C++/python AI BI 运维开发自动化运维。 春风桃李花 秋雨梧桐叶。“力尽不知热 但惜夏日长”。夏不惜,秋不获。@ruiY--秦瑞

python爬虫,C编程,嵌入式开发.hadoop大数据,桉树,onenebula云计算架构.linux运维及驱动开发.

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
#user  nginx;
worker_processes  5;

#error_log  /var/log/nginx/error.log warn;
#pid        /var/run/nginx.pid;


events {
    worker_connections  10240;
}

http {
    include       mime.types;
    default_type  application/octet-stream;

    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;

   upstream Jq_one{
    #server 192.168.11.175:8090;
    #server 192.168.11.192:8090;
    server  zh.hainan.gov.cn;
    #server  10.34.1.31;
    }

    server {
        listen       90;
        server_name  10.34.1.21;
     
        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        #location / {
        #    root   html;
        #    index  index.html index.htm;
        #}
    #my own location
    location / {
        proxy_pass         http://Jq_one; 
        #proxy_pass http://localhost;
        #proxy_redirect / /ahyc/Web_Water/;
     #proxy_redirect default;
     root   html;
        index  index.aspx index.html index.htm; #修改主页为index.aspx
     #其中jq_one 对应着upstream设置的集群名称
     
     #设置主机头和客户端真实地址,以便服务器获取客户端真实IP
     proxy_set_header   Host             $host; 
     proxy_set_header   X-Real-IP        $remote_addr; 
     proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;

}}

#第二个port app test;
upstream ahwater_portal{
server 10.34.1.31;
}
server {
        listen       91;
        server_name  10.34.1.21;
    location / {
        proxy_pass         http://ahwater_portal; 
     root   html;
        index  index.aspx index.html index.htm; #修改主页为index.aspx
     #其中jq_one 对应着upstream设置的集群名称
     
     #设置主机头和客户端真实地址,以便服务器获取客户端真实IP
     proxy_set_header   Host             $host; 
     proxy_set_header   X-Real-IP        $remote_addr; 
     proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;

}}
#第二个port app test;
upstream ahwater_portal2{
server 10.2.1.221;
}
server {
        listen       92;
        server_name  10.34.1.21;
    location /{
       proxy_pass   http://ahwater_portal2; 
       root        html;
       index  index.aspx index.html index.htm; #修改主页为index.aspx
        
     #其中jq_one 对应着upstream设置的集群名称
     
     #设置主机头和客户端真实地址,以便服务器获取客户端真实IP
     proxy_set_header   Host             $host; 
     proxy_set_header   X-Real-IP        $remote_addr; 
     proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;

       } 

}




}

 

posted on 2018-01-31 14:37  秦瑞It行程实录  阅读(608)  评论(0编辑  收藏  举报
www.cnblogs.com/ruiyqinrui