nginx配置

2018-09-29  本文已影响0人  凉介Seven

# 全局块

worker_processes  4;  # 允许生成worker process数。

daemon off; # 确定nginx是否应该成为守护进程。主要用于开发过程中。

error_log logs/error.log debug; # 错误生成的文件地址

#events块

events {

    worker_connections  1024;  #设置工作进程可以打开的最大并发连接数。

}

#http块

http {

    include      mime.types;  #包含另一个file或与指定匹配的文件mask到配置中。包含的文件应包含语法正确的指令和块。

    default_type  application/octet-stream;

    client_max_body_size 5000m;

    sendfile        on;

    keepalive_timeout  65;

  fastcgi_connect_timeout 600;

  fastcgi_send_timeout 600;

    fastcgi_read_timeout 600;

  proxy_connect_timeout 600;           

  proxy_read_timeout    600;             

  proxy_send_timeout    600;           

  upstream phpfastcgi_proxy {

    server 127.0.0.1:9000;

    server 127.0.0.1:9001;

    server 127.0.0.1:9002;

    server 127.0.0.1:9001;

  }

  underscores_in_headers on;

#server块  

#hrui

server {

  listen      1222;

  server_name  172.30.34.51;

  #hrui  本地地址

  location /hrui {

    proxy_pass http://172.30.34.51:8082/;

  }

  #HRUI 后端地址

  location /hrs {

    proxy_pass  http://192.168.2.8:8662/hrs; #测试环境

  }

  #oaui2S 后端地址

  location /oas {

    proxy_pass http://192.168.2.8:21583/oas; #OAservice2 测试空间OASERVICE2

    # proxy_pass http://172.30.34.55:7989/; #陈广义/;

  }

  #CW 后端地址

  location /cws {

    proxy_pass http://192.168.2.8:21583/cws; #OAservice2 测试空间OASERVICE2

    # proxy_pass http://172.30.34.39:1111/; #吴相锋

  }

  # ftp(ui3ftp) 文件上传

  location /resources {

    #proxy_pass http://192.168.0.8:21591/; #测试环境

    proxy_pass http://172.30.34.40:6241/; #叶钊

  }

}

#OA  nginx配置

  server {

    listen      1200;

    server_name  172.30.34.51;

    #oaold

    location / {

      proxy_pass http://172.30.34.51:8001; #郑凡君  oaold

    }

    #UI2

    location /ui2 {

      proxy_pass http://172.30.34.51:1277/; #郑凡君  ui2

    }

    #UI3

    location /ui3 {

      proxy_pass http://127.0.0.1:8081/; #郑凡君  ui3

    }

    #oaui2S 后端地址

    # 询盘小程序PC接口(目前嵌在ui3)

    location /queryPC {

      proxy_pass http://test.xp.yumc.pw/api/; #询盘小程序 测试空间

      # proxy_pass http://dev.xp.yumc.pw/api/; #询盘小程序 开发环境

      # proxy_pass https://e.sixi.com/api/; #询盘小程序 线上环境

    }

    # OAservices2

    location /oas {

      proxy_pass  http://192.168.2.8:21583/oas/; #测试环境

      # proxy_pass http://172.30.34.100:7989/; #李韧

      # proxy_pass http://172.30.34.55:7989/; #陈广义

      # proxy_pass http://172.30.34.40:6248/; #叶钊

      # proxy_pass http://172.30.34.79:9022/; #华哥

      # proxy_pass http://172.30.34.39:8123/; #相锋

      # proxy_pass http://172.30.34.216:7777/; #邵野

    }

    #CW 后端地址

    location /cws {

      proxy_pass  http://192.168.2.8:21583/cws/; #测试环境

      # proxy_pass http://172.30.34.55:7021/; #陈广义

      # proxy_pass http://172.30.34.39:1249/; #吴相锋

      # proxy_pass http://172.30.34.40:6242/; #叶钊

    }

    #oaui3 ftp 图片上传

    location /resources {

      proxy_pass http://192.168.0.8:21591/; #测试环境

      # proxy_pass http://172.30.34.40:6241/; #叶钊

    }

  }

# OADYW

  server {

    listen      1234;

    server_name  172.30.34.51;

    #oadyw

    location / {

      proxy_pass http://172.30.34.51:1232;

    }

    #ui3

    location /ui3 {

      proxy_pass http://172.30.34.51:1200;

    }

    #dyw

    location /ui2 {

      proxy_pass http://172.30.34.51:1277/;

    }

    #oaui2S

    location /oas {

      proxy_pass  http://192.168.2.8:21583/oas/; #测试环境

    }

    #CW

    location /cws {

      proxy_pass  http://192.168.2.8:21583/cws/; #测试环境

    }

    #oaui3 ftp

    location /ftp {

      proxy_pass http://172.30.34.40:6241/; #叶钊

    }

  }

# CWUI -> FinUI2

  server {

    listen    2345;

    server_name 172.30.34.51;

    location / {

      root  E:/sixi-pro/DJL/OA/FinUI2;

      index index.html index.htm index.php;

      if (!-e $request_filename) {

        rewrite  ^/(.*)$  /index.php/$1  last;

        break;

      }

    }

    error_page  500 502 503 504  /50x.html;

    location = /50x.html {

      root  E:/sixi-pro/DJL/OA/FinUI2;

    }

    location ~ \.php {

      root    E:/sixi-pro/DJL/OA/FinUI2;

      fastcgi_pass  127.0.0.1:9000;

      fastcgi_index index.php;

      include        fastcgi.conf;

      set $fastcgi_script_name2 $fastcgi_script_name;

      if ($fastcgi_script_name2 ~ "^(.+\.php)(/.+)$") {

          set $fastcgi_script_name2 $1;

          set $path_info $2;

      } 

      fastcgi_param  PATH_INFO $path_info;

      fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name2;

      fastcgi_param  SCRIPT_NAME  $fastcgi_script_name2;

    }

  }

#OAUI2 V2.0

  server {

    listen    1277;

    server_name 172.30.34.51;

    location / {

      root  E:/sixi-pro/DJL/OA/OAUI2;

      index index.html index.htm index.php;

      if (!-e $request_filename) {

        rewrite  ^/(.*)$  /index.php/$1  last;

        break; 

      }

    }

    error_page  500 502 503 504  /50x.html;

    location = /50x.html {

      root  E:/sixi-pro/DJL/OA/OAUI2;

    }

    location ~ \.php {

      root  E:/sixi-pro/DJL/OA/OAUI2;

      fastcgi_pass  127.0.0.1:9000;

      fastcgi_index index.php;

      include        fastcgi.conf;

      set $fastcgi_script_name2 $fastcgi_script_name;

      if ($fastcgi_script_name2 ~ "^(.+\.php)(/.+)$") {

          set $fastcgi_script_name2 $1;

          set $path_info $2;

      } 

      fastcgi_param  PATH_INFO $path_info;

      fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name2;

      fastcgi_param  SCRIPT_NAME  $fastcgi_script_name2;

    }

  }

}

上一篇下一篇

猜你喜欢

热点阅读