环境配置记录

 

JAVA

export JAVA_HOME=/usr/java/jdk1.8.0_161
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

 

NGINX:

Ubuntu Nginx:http://wiki.ubuntu.org.cn/Nginx

安装:

sudo apt-get update
sudo apt-get install nginx

卸载:

# 卸载删除除了配置文件以外的所有文件。
sudo apt-get remove nginx nginx-common

# 卸载所有东东,包括删除配置文件。 
sudo apt-get purge nginx nginx-common

# 在上面命令结束后执行,主要是卸载删除Nginx的不再被使用的依赖包。
sudo apt-get autoremove

#卸载删除两个主要的包。
sudo apt-get remove nginx-full nginx-common

nginx参考:https://www.cnblogs.com/zhaoyingjie/p/6840616.html

安装:

sudo apt-add-repository ppa:nginx/development  
sudo apt-get update  
sudo apt-get install nginx 

配置:

sudo vim /usr/share/nginx/www/index.html 
#sudo find / -name nginx.conf | less  
sudo vim /etc/nginx/nginx.conf 

 

配置测试:

sudo nginx -t  

服务管理:

sudo /etc/init.d/nginx start  
sudo nginx -s reload
sudo service nginx start|stop|restart 

 

卸载1: 

# 删除nginx,保留配置文件  
sudo apt-get remove nginx 

#删除配置文件 
rm -rf /etc/nginx

卸载2:

#删除nginx连带配置文件  
sudo apt-get purge nginx

#卸载不再需要的nginx依赖程序 
sudo apt-get autoremove 

 

 

测试访问:http://39.107.115.160/ 

 

git push 

cd /d E:/TEST_ENV/BESRA
git clone ssh://git@scm.lifeccp.com:10022/lifeccp/besra.git
cd besra
git checkout -b release 6d1485e11203d08240337efe6686ca5c7ba14289
git tag release-besra-20180206
git push --tags
git push origin release:release


cd /d E:/TEST_ENV/BESRA
git clone ssh://git@scm.lifeccp.com:10022/goshawk/besra-dashboard.git
cd besra-dashboard
git checkout -b release 23694dc467a168bb544ae3e5b11041442052a178
git tag release-besra-dashboard-20180206
git push --tags
git push origin release:release

pause .

 

 

Nginx conf.d

lifeccp@lifeccptest1:/etc/nginx/conf.d$ cat test.conf
limit_req_zone $binary_remote_addr zone=allips:10m rate=1r/s;
limit_req_status 429;

server {
    listen 80;
    server_name test.lifeccp.com;
    return 301 https://$server_name$request_uri;

    #root /usr/local/nginx/html ;
    #access_log  /usr/local/nginx/logs/nx.access.log;
    #error_log   /usr/local/nginx/logs/nx.error.log;

    #location / {
    #    expires 1h;
    #    root   /usr/local/nginx/html/elanus;
    #}

    #location /portal {
    #   if (-f $document_root/maintenance_on.html) {
    #      return 503;
    #   }
    #   proxy_pass http://127.0.0.1:8090;
    #   proxy_set_header Host $host;
    #   proxy_set_header X-Real-IP $remote_addr;
    #   proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    #   proxy_set_header Upgrade $http_upgrade;
    #   proxy_set_header Connection "upgrade";
    #}

    #location /admin/ {
    #   proxy_pass http://10.28.205.89:8080;
    #   proxy_set_header Host $host;
    #   proxy_set_header X-Real-IP $remote_addr;
    #   proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    #   proxy_set_header Upgrade $http_upgrade;
    #   proxy_set_header Connection "upgrade";
    #}

    #location /view/ {
    #   proxy_pass http://127.0.0.1:8084;
    #   proxy_set_header Host $host;
    #   proxy_set_header X-Real-IP $remote_addr;
    #   proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    #   proxy_set_header Upgrade $http_upgrade;
    #   proxy_set_header Connection "upgrade";
    #}

    #location /wxchat/ {
    #   proxy_pass http://127.0.0.1:8090;
    #   proxy_set_header Host $host;
    #   proxy_set_header X-Real-IP $remote_addr;
    #   proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    #   proxy_set_header Upgrade $http_upgrade;
    #   proxy_set_header Connection "upgrade";
    #}

    #location /coochat/ {
    #   proxy_pass http://127.0.0.1:8090;
    #   proxy_set_header Host $host;
    #   proxy_set_header X-Real-IP $remote_addr;
    #   proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    #   proxy_set_header Upgrade $http_upgrade;
    #   proxy_set_header Connection "upgrade";
    #}

    #location /cara-trace/ {
    #   proxy_pass http://10.45.52.164:3000;
    #   proxy_set_header Host $host;
    #   proxy_set_header X-Real-IP $remote_addr;
    #   proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    #   proxy_set_header Upgrade $http_upgrade;
    #   proxy_set_header Connection "upgrade";
    #}

    #location /m/ {
    #    root   /usr/local/nginx/html;
    #    try_files $uri $uri/ /m/index.html =404;
    #}

    #location /ef/ {
    #    root   /usr/local/nginx/html;
    #    try_files $uri $uri/ /ef/index.html =404;
    #}

    #location /demo/ {
    #    root   /usr/local/nginx/html;
    #    add_header Access-Control-Allow-Origin *;
    #}

    #location ~ ^/(certificationAuthority|case|configs|consultationlComment|consultationl|dic|enterprise|expert|group|hospital|api|knowledges|users|opertionChiefs|report|tasks|wechat|bjca)/ {
    #   if (-f $document_root/maintenance_on.html) {
    #      return 503;
    #   }
    #   rewrite ^/(.*)$ /portal/$1 break;
    #   proxy_pass http://127.0.0.1:8090;
    #   proxy_set_header Host $host;
    #   proxy_set_header X-Real-IP $remote_addr;
    #   proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    #   proxy_set_header Upgrade $http_upgrade;
    #   proxy_set_header Connection "upgrade";
    #}

    #return 301 http://$server_name$request_uri;
}
upstream portals {
    server 192.168.1.21:8080;
    server 192.168.1.23:8080;
    # server 192.168.1.23:8085;
}
server {
    listen 443;
    server_name  test.lifeccp.com;
    ssl on;
    # ssl_certificate /etc/letsencrypt/live/test.lifeccp.com/fullchain.pem;
    # ssl_certificate_key /etc/letsencrypt/live/test.lifeccp.com/privkey.pem;

    ssl_certificate /etc/nginx/ssl/nginx.crt;
    ssl_certificate_key /etc/nginx/ssl/nginx.key;

    # ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    # ssl_prefer_server_ciphers on;
    # ssl_dhparam /etc/ssl/certs/dhparam.pem;
    # ssl_ciphers "EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM EECDH+ECDSA+SHA384 EECDH+ECDSA+SHA256 EECDH+aRSA+SHA384 EECDH+aRSA+SHA256 EECDH+aRSA+RC4 EECDH EDH+aRSA !aNULL !eNULL !LOW !3DES !MD5 !EXP !PSK !SRP !DSS !RC4";

    #ssl_protocols TLSv1.2 TLSv1.1 TLSv1 SSLv3;
    #ssl_ciphers "ECDHE-ECDSA-CHACHA20-POLY1305 ECDHE-RSA-CHACHA20-POLY1305 ECDHE-RSA-AES128-GCM-SHA256 ECDHE-ECDSA-AES128-GCM-SHA256 ECDHE-RSA-AES256-GCM-SHA384 ECDHE-ECDSA-AES256-GCM-SHA384 DHE-RSA-AES128-GCM-SHA256 DHE-DSS-AES128-GCM-SHA256 kEDH+AESGCM ECDHE-RSA-AES128-SHA256 ECDHE-ECDSA-AES128-SHA256 ECDHE-RSA-AES128-SHA ECDHE-ECDSA-AES128-SHA ECDHE-RSA-AES256-SHA384 ECDHE-ECDSA-AES256-SHA384 ECDHE-RSA-AES256-SHA ECDHE-ECDSA-AES256-SHA DHE-RSA-AES128-SHA256 DHE-RSA-AES128-SHA DHE-DSS-AES128-SHA256 DHE-RSA-AES256-SHA256 DHE-DSS-AES256-SHA DHE-RSA-AES256-SHA ECDHE-RSA-DES-CBC3-SHA ECDHE-ECDSA-DES-CBC3-SHA EDH-RSA-DES-CBC3-SHA AES128-GCM-SHA256 AES256-GCM-SHA384 AES128-SHA256 AES256-SHA256 AES128-SHA AES256-SHA AES DES-CBC3-SHA HIGH SEED !aNULL !eNULL !EXPORT !DES !RC4 !MD5 !PSK !RSAPSK !aDH !aECDH !EDH-DSS-DES-CBC3-SHA !KRB5-DES-CBC3-SHA !SRP";


    # ssl_session_cache shared:SSL:10m;
    # ssl_session_timeout 10m;


#    location /.well-known/ {
#        root   /usr/local/nginx/html/letsencrypt;
#    }

#    access_log  /usr/local/nginx/logs/nx.access.log;
#    error_log   /usr/local/nginx/logs/nx.error.log;
     error_log  /var/log/nginx/error.log;
     access_log  /var/log/nginx/access.log;

    location / {
    expires 1h;
        #root   /usr/local/nginx/html/elanus;
        root   /var/www/html/elanus;
    }

    location /portal/tasks/menuTask {
       if (-f $document_root/maintenance_on.html) {
          return 503;
       }
       proxy_pass http://portals;
       proxy_set_header Host $host;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_set_header Upgrade $http_upgrade;
       proxy_set_header Connection "upgrade";
       ### limit_req zone=allips nodelay;
    }

    location /portal {
       if (-f $document_root/maintenance_on.html) {
          return 503;
       }
       proxy_pass http://portals;
       proxy_set_header Host $host;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_set_header Upgrade $http_upgrade;
       proxy_set_header Connection "upgrade";
    }


    location /admin/ {
       proxy_pass http://192.168.1.21:8082;
       proxy_set_header Host $host;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_set_header Upgrade $http_upgrade;
       proxy_set_header Connection "upgrade";
    }

    location /view/ {
       proxy_pass http://192.168.1.23:8072;
       proxy_set_header Host $host;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_set_header Upgrade $http_upgrade;
       proxy_set_header Connection "upgrade";
       add_header X-Real-IP $remote_addr;
       #add_header X-Squid-Osprey $http_x_squid_osprey;
    }

    location /wxchat/ {
       proxy_pass http://192.168.1.21:8060;
       proxy_set_header Host $host;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_set_header Upgrade $http_upgrade;
       proxy_set_header Connection "upgrade";
    }

    location /coochat/ {
       proxy_pass http://192.168.1.21:8061;
       proxy_set_header Host $host;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_set_header Upgrade $http_upgrade;
       proxy_set_header Connection "upgrade";
    }

    location ~ ^/besra/dashboard/(.*)$ {
       proxy_pass http://127.0.0.1:8091/dashboard/$1$is_args$args;
       proxy_set_header Host $host;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_set_header Upgrade $http_upgrade;
       proxy_set_header Connection "upgrade";
    }

    location /besra/ {
       proxy_pass http://192.168.1.22:8090;
       proxy_set_header Host $host;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_set_header Upgrade $http_upgrade;
       proxy_set_header Connection "upgrade";
    }

    location /boss/ {
        # root   /usr/local/nginx/html;
        root   /var/www/html;
    try_files $uri $uri/ /boss/index.html =404;
    }

    location /m/ {
        # root   /usr/local/nginx/html;
        root   /var/www/html;
    try_files $uri $uri/ /m/index.html =404;
    }

    location /ef/ {
        # root   /usr/local/nginx/html;
        root   /var/www/html;
    try_files $uri $uri/ /ef/index.html =404;
    }

    location /gef/ {
        rewrite ^/gef/(.*)$ /ef/g/$1 redirect;
    #try_files $uri $uri/ /gef/index.html =404;
    }

#    location /at/ {
#    return 301 https://test.lifeccp.ai/at/;
#        root   /usr/local/nginx/html;
#    try_files $uri $uri/ /boss/index.html =404;
#    }

    location /9/ {
        # root   /usr/local/nginx/html;
        root   /var/www/html;
    try_files $uri $uri/ /9/index.html =404;
    }

    location /rt/ {
        # root   /usr/local/nginx/html;
        root   /var/www/html;
    try_files $uri $uri/ /rt/index.html =404;
    }

    location /webrtc/ {
        # root   /usr/local/nginx/html;
        root   /var/www/html;
    try_files $uri $uri/ /webrtc/index.html =404;
    }

    # at's api
    location ~ ^/at/api/(.*)$ {
       proxy_pass https://test.lifeccp.ai/at/api/$1$is_args$args;
       #proxy_pass http://10.45.52.164:3000/$1$is_args$args;
       proxy_set_header Host $host;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_set_header Upgrade $http_upgrade;
       proxy_set_header Connection "upgrade";
    }
    #location ~ ^/at/api2/(.*)$ {
    #   proxy_pass http://47.95.199.132:3002/$1$is_args$args;
    #   proxy_set_header Host $host;
    #   proxy_set_header X-Real-IP $remote_addr;
    #   proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    #   proxy_set_header Upgrade $http_upgrade;
    #   proxy_set_header Connection "upgrade";
    #}

    location /socket.io/ {
       proxy_pass http://47.95.199.132:3010;
       proxy_set_header Host $host;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_set_header Upgrade $http_upgrade;
       proxy_set_header Connection "upgrade";
    }

    location /demo/ {
        # root   /usr/local/nginx/html;
        root   /var/www/html;
    add_header Access-Control-Allow-Origin *;
    }


    location ~ ^/(certificationAuthority|case|configs|consultationlComment|consultationl|dic|enterprise|expert|group|hospital|api|knowledges|users|opertionChiefs|report|tasks|wechat|bjca)/ {
       if (-f $document_root/maintenance_on.html) {
          return 503;
       }
       rewrite ^/(.*)$ /portal/$1 break;
       proxy_pass http://portals;
       #proxy_pass http://127.0.0.1:8091;
       proxy_set_header Host $host;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_set_header Upgrade $http_upgrade;
       proxy_set_header Connection "upgrade";
    }

    #return 301 http://$server_name$request_uri;
}
server {
    listen 443;
    server_name  test.lifeccp.com;
    ssl on;
    # ssl_certificate /etc/letsencrypt/live/test.lifeccp.com/fullchain.pem;
    # ssl_certificate_key /etc/letsencrypt/live/test.lifeccp.com/privkey.pem;
    ssl_certificate /etc/nginx/ssl/nginx.crt;
    ssl_certificate_key /etc/nginx/ssl/nginx.key;

    # ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    # ssl_prefer_server_ciphers on;
    # ssl_dhparam /etc/ssl/certs/dhparam.pem;
    # ssl_ciphers "EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM EECDH+ECDSA+SHA384 EECDH+ECDSA+SHA256 EECDH+aRSA+SHA384 EECDH+aRSA+SHA256 EECDH+aRSA+RC4 EECDH EDH+aRSA !aNULL !eNULL !LOW !3DES !MD5 !EXP !PSK !SRP !DSS !RC4";

    #ssl_protocols TLSv1.2 TLSv1.1 TLSv1 SSLv3;
    #ssl_ciphers "ECDHE-ECDSA-CHACHA20-POLY1305 ECDHE-RSA-CHACHA20-POLY1305 ECDHE-RSA-AES128-GCM-SHA256 ECDHE-ECDSA-AES128-GCM-SHA256 ECDHE-RSA-AES256-GCM-SHA384 ECDHE-ECDSA-AES256-GCM-SHA384 DHE-RSA-AES128-GCM-SHA256 DHE-DSS-AES128-GCM-SHA256 kEDH+AESGCM ECDHE-RSA-AES128-SHA256 ECDHE-ECDSA-AES128-SHA256 ECDHE-RSA-AES128-SHA ECDHE-ECDSA-AES128-SHA ECDHE-RSA-AES256-SHA384 ECDHE-ECDSA-AES256-SHA384 ECDHE-RSA-AES256-SHA ECDHE-ECDSA-AES256-SHA DHE-RSA-AES128-SHA256 DHE-RSA-AES128-SHA DHE-DSS-AES128-SHA256 DHE-RSA-AES256-SHA256 DHE-DSS-AES256-SHA DHE-RSA-AES256-SHA ECDHE-RSA-DES-CBC3-SHA ECDHE-ECDSA-DES-CBC3-SHA EDH-RSA-DES-CBC3-SHA AES128-GCM-SHA256 AES256-GCM-SHA384 AES128-SHA256 AES256-SHA256 AES128-SHA AES256-SHA AES DES-CBC3-SHA HIGH SEED !aNULL !eNULL !EXPORT !DES !RC4 !MD5 !PSK !RSAPSK !aDH !aECDH !EDH-DSS-DES-CBC3-SHA !KRB5-DES-CBC3-SHA !SRP";


    # ssl_session_cache shared:SSL:10m;
    # ssl_session_timeout 10m;


#    location /.well-known/ {
#        root   /usr/local/nginx/html/letsencrypt;
#    }

#    access_log  /usr/local/nginx/logs/nx.access.log;
#    error_log   /usr/local/nginx/logs/nx.error.log;
      error_log  /var/log/nginx/error.log;
      access_log  /var/log/nginx/access.log;

    location / {
    expires 1h;
        # root   /usr/local/nginx/html/elanus;
        # root   /usr/local/nginx/html;
        root   /var/www/html/elanus;
    }

    location /portal/tasks/menuTask {
       if (-f $document_root/maintenance_on.html) {
          return 503;
       }
       proxy_pass http://portals;
       proxy_set_header Host $host;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_set_header Upgrade $http_upgrade;
       proxy_set_header Connection "upgrade";
       ### limit_req zone=allips nodelay;
    }

    location /portal {
       if (-f $document_root/maintenance_on.html) {
          return 503;
       }
       proxy_pass http://portals;
       proxy_set_header Host $host;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_set_header Upgrade $http_upgrade;
       proxy_set_header Connection "upgrade";
    }


    location /admin/ {
       proxy_pass http://192.168.1.19:8080;
       proxy_set_header Host $host;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_set_header Upgrade $http_upgrade;
       proxy_set_header Connection "upgrade";
    }

    location /view/ {
       proxy_pass http://127.0.0.1:8084;
       proxy_set_header Host $host;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_set_header Upgrade $http_upgrade;
       proxy_set_header Connection "upgrade";
       add_header X-Real-IP $remote_addr;
       #add_header X-Squid-Osprey $http_x_squid_osprey;
    }

    location /wxchat/ {
       proxy_pass http://127.0.0.1:8092;
       proxy_set_header Host $host;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_set_header Upgrade $http_upgrade;
       proxy_set_header Connection "upgrade";
    }

    location /coochat/ {
       proxy_pass http://127.0.0.1:8093;
       proxy_set_header Host $host;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_set_header Upgrade $http_upgrade;
       proxy_set_header Connection "upgrade";
    }

    location ~ ^/besra/dashboard/(.*)$ {
       proxy_pass http://127.0.0.1:8091/dashboard/$1$is_args$args;
       proxy_set_header Host $host;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_set_header Upgrade $http_upgrade;
       proxy_set_header Connection "upgrade";
    }

    location /besra/ {
       proxy_pass http://192.168.1.22:8090;
       proxy_set_header Host $host;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_set_header Upgrade $http_upgrade;
       proxy_set_header Connection "upgrade";
    }

    location /boss/ {
        root   /var/www/html;
    try_files $uri $uri/ /boss/index.html =404;
    }

    location /m/ {
        # root   /usr/local/nginx/html;
        root   /var/www/html;
    try_files $uri $uri/ /m/index.html =404;
    }

    location /ef/ {
        # root   /usr/local/nginx/html;
        root   /var/www/html;
    try_files $uri $uri/ /ef/index.html =404;
    }

    location /gef/ {
        rewrite ^/gef/(.*)$ /ef/g/$1 redirect;
    #try_files $uri $uri/ /gef/index.html =404;
    }

#    location /at/ {
#    return 301 https://test.lifeccp.ai/at/;
#        root   /usr/local/nginx/html;
#    try_files $uri $uri/ /boss/index.html =404;
#    }

    location /9/ {
        # root   /usr/local/nginx/html;
        root   /var/www/html;
    try_files $uri $uri/ /9/index.html =404;
    }

    location /rt/ {
        # root   /usr/local/nginx/html;
        root   /var/www/html;
    try_files $uri $uri/ /rt/index.html =404;
    }

    location /webrtc/ {
        # root   /usr/local/nginx/html;
        root   /var/www/html;
    try_files $uri $uri/ /webrtc/index.html =404;
    }

    # at's api
    location ~ ^/at/api/(.*)$ {
       proxy_pass https://test.lifeccp.ai/at/api/$1$is_args$args;
       #proxy_pass http://10.45.52.164:3000/$1$is_args$args;
       proxy_set_header Host $host;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_set_header Upgrade $http_upgrade;
       proxy_set_header Connection "upgrade";
    }
    #location ~ ^/at/api2/(.*)$ {
    #   proxy_pass http://47.95.199.132:3002/$1$is_args$args;
    #   proxy_set_header Host $host;
    #   proxy_set_header X-Real-IP $remote_addr;
    #   proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    #   proxy_set_header Upgrade $http_upgrade;
    #   proxy_set_header Connection "upgrade";
    #}

    location /socket.io/ {
       proxy_pass http://47.95.199.132:3010;
       proxy_set_header Host $host;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_set_header Upgrade $http_upgrade;
       proxy_set_header Connection "upgrade";
    }

    location /demo/ {
        # root   /usr/local/nginx/html;
        root   /var/www/html;
    add_header Access-Control-Allow-Origin *;
    }


    location ~ ^/(certificationAuthority|case|configs|consultationlComment|consultationl|dic|enterprise|expert|group|hospital|api|knowledges|users|opertionChiefs|report|tasks|wechat|bjca)/ {
       if (-f $document_root/maintenance_on.html) {
          return 503;
       }
       rewrite ^/(.*)$ /portal/$1 break;
       proxy_pass http://portals;
       #proxy_pass http://127.0.0.1:8091;
       proxy_set_header Host $host;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_set_header Upgrade $http_upgrade;
       proxy_set_header Connection "upgrade";
    }

    #return 301 http://$server_name$request_uri;
}


server {
    listen 8888;
    server_name  test.lifeccp.com;

    #location /.well-known/ {
    #    root   /usr/local/nginx/html/letsencrypt;
    #}

    # access_log  /usr/local/nginx/logs/nx.access.log;
    # error_log   /usr/local/nginx/logs/nx.error.log;
     error_log  /var/log/nginx/error.log;
     access_log  /var/log/nginx/access.log;

    location / {
        # root   /usr/local/nginx/html/elanus;
        root   /var/www/html/elanus;
    }

    location /portal {
       if (-f $document_root/maintenance_on.html) {
          return 503;
       }
       proxy_pass http://portals;
       proxy_set_header Host $host;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_set_header Upgrade $http_upgrade;
       proxy_set_header Connection "upgrade";
    }

    location /admin/ {
       proxy_pass http://192.168.1.21:8082;
       proxy_set_header Host $host;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_set_header Upgrade $http_upgrade;
       proxy_set_header Connection "upgrade";
    }

    location /view/ {
       proxy_pass http://192.168.1.23:8072;
       proxy_set_header Host $host;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_set_header Upgrade $http_upgrade;
       proxy_set_header Connection "upgrade";
       add_header X-Squid-Osprey $http_x_squid_osprey;
    }

    location /wxchat/ {
       proxy_pass http://192.168.1.21:8060;
       proxy_set_header Host $host;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_set_header Upgrade $http_upgrade;
       proxy_set_header Connection "upgrade";
    }

    location /coochat/ {
       proxy_pass http://192.168.1.21:8061;
       proxy_set_header Host $host;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_set_header Upgrade $http_upgrade;
       proxy_set_header Connection "upgrade";
    }

    location /boss/ {
       # root   /etc/nginx/html;
        root   /var/www/html;
    }

    location /m/ {
       # root   /etc/nginx/html;
        root   /var/www/html;

    }

    location /ef/ {
       # root   /etc/nginx/html;
        root   /var/www/html;
    try_files $uri $uri/ /ef/index.html =404;
    }

    location /9/ {
       # root   /etc/nginx/html;
        root   /var/www/html;
    try_files $uri $uri/ /9/index.html =404;
    }

    location /rt/ {
       # root   /etc/nginx/html;
        root   /var/www/html;
    try_files $uri $uri/ /rt/index.html =404;
    }

    location /demo/ {
       # root   /etc/nginx/html;
        root   /var/www/html;
    add_header Access-Control-Allow-Origin *;
    }

    location /socket.io/ {
       proxy_pass http://47.95.199.132:3010;
       proxy_set_header Host $host;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_set_header Upgrade $http_upgrade;
       proxy_set_header Connection "upgrade";
    }
}
lifeccp@lifeccptest1:/etc/nginx/conf.d$

 

 

</待续>

posted @ 2018-01-29 11:23  念槐聚  阅读(155)  评论(0)    收藏  举报