| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295 |
- user nobody;
- worker_processes 2;
- error_log logs/error.log;
- #error_log logs/error.log notice;
- #error_log logs/error.log info;
- #pid logs/nginx.pid;
- events {
- worker_connections 1024;
- }
- http {
- include mime.types;
- default_type application/octet-stream;
- client_max_body_size 30M;
- 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;
- server {
- listen 98;
- location / {
- 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_pass http://127.0.0.1:9800;
- }
- location /mqtt {
- 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_pass http://127.0.0.1:1884;
- proxy_http_version 1.1;
- proxy_set_header Upgrade $http_upgrade;
- proxy_set_header Connection "upgrade";
- }
-
- }
- #静态文件根路径
- server {
- listen 81;
- location / {
- root /home/web/;
- try_files $uri $uri/ /index.html;
- index index.html;
- }
- }
- server {
- listen 80;
- server_name test.com localnet.com www.test.com 192.168.1.88;
- #charset koi8-r;
- access_log logs/host.access.log main;
- error_page 404 /404.html;
- error_page 500 502 503 504 /50x.html;
- location = /50x.html {
- root html;
- }
-
- location /statics/ {
- proxy_redirect off;
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- client_max_body_size 1000m;
- proxy_read_timeout 3600s;#超时设置
- proxy_pass http://127.0.0.1/labSystem/statics/;
- }
-
-
- location ^~/labSystem/admin/statics/ {
- proxy_redirect off;
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- client_max_body_size 1000m;
- proxy_read_timeout 3600s;#超时设置
- proxy_pass http://127.0.0.1/labSystem/statics/;
- }
-
-
- location /mettingroom/ {
- proxy_redirect off;
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- client_max_body_size 1000m;
- proxy_read_timeout 3600s;#超时设置
- proxy_pass http://127.0.0.1:8080/mettingroom/;
- }
- location ^~/mettingroom/admin/ {
- proxy_redirect off;
- 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_read_timeout 3600s;#超时设置
- proxy_pass http://127.0.0.1:81/mettingroom/;
- }
- #jenkins相关配置
- location /jenkins/ {
- proxy_redirect off;
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- client_max_body_size 1000m;
- proxy_read_timeout 3600s;#超时设置
- proxy_pass http://127.0.0.1:8082/jenkins/;
- }
- #git相关配置
- location /gogs/ {
- proxy_redirect off;
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- client_max_body_size 1000m;
- proxy_read_timeout 3600s;#超时设置
- proxy_pass http://127.0.0.1:3000/;
- }
- #wq相关配置
- location /wq/ {
- proxy_redirect off;
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- client_max_body_size 1000m;
- proxy_read_timeout 3600s;#超时设置
- proxy_pass http://127.0.0.1:8083/wq/;
- }
- location ^~/wq/admin/ {
- proxy_redirect off;
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- client_max_body_size 1000m;
- proxy_read_timeout 3600s;#超时设置
- proxy_pass http://127.0.0.1:81/wq/;
- }
-
- #wq相关配置
- location /xzgd/ {
- proxy_redirect off;
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- client_max_body_size 1000m;
- proxy_read_timeout 3600s;#超时设置
- proxy_pass http://127.0.0.1:8091/xzgd/;
- }
- location ^~/xzgd/admin/ {
- proxy_redirect off;
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- client_max_body_size 1000m;
- proxy_read_timeout 3600s;#超时设置
- proxy_pass http://127.0.0.1:81/xzgd/;
- }
- location /labSystem/ {
- proxy_redirect off;
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- client_max_body_size 1000m;
- proxy_read_timeout 3600s;#超时设置
- proxy_pass http://127.0.0.1:9800/;
- }
- location ^~/labSystem/admin/ {
- proxy_redirect off;
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- client_max_body_size 1000m;
- proxy_read_timeout 3600s;#超时设置
- proxy_pass http://127.0.0.1:81/labSystem/;
- }
- location ^~/labSystem/bigData/ {
- proxy_redirect off;
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- client_max_body_size 1000m;
- proxy_read_timeout 3600s;#超时设置
- proxy_pass http://127.0.0.1:81/bigData/;
- }
- location ^~/labSystem/labBigData/ {
- proxy_redirect off;
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- client_max_body_size 1000m;
- proxy_read_timeout 3600s;#超时设置
- proxy_pass http://127.0.0.1:81/labBigData/;
- }
- }
- server {
- listen 443 ssl;
- server_name lab.sxitdlc.com;
-
- #ssl on;
- ssl_certificate /usr/local/nginx/cert/server.crt;
- ssl_certificate_key /usr/local/nginx/cert/server.key;
-
- ssl_session_timeout 5m;
- ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
- ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
- ssl_prefer_server_ciphers on;
-
- #add_header Access-Control-Allow-Origin *;
- #add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS';
- #add_header Access-Control-Allow-Headers 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization';
- #if ($request_method = 'OPTIONS') {
- # return 204;
- #}
-
- location / {
- root /home/;
- #index index.html index.htm;
- }
-
- location /statics/ {
- proxy_redirect off;
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- client_max_body_size 1000m;
- proxy_read_timeout 3600s;#超时设置
- proxy_pass http://127.0.0.1/labSystem/statics/;
- }
-
-
- location ^~/labSystem/admin/statics/ {
- proxy_redirect off;
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- client_max_body_size 1000m;
- proxy_read_timeout 3600s;#超时设置
- proxy_pass http://127.0.0.1/labSystem/statics/;
- }
-
-
- location /labSystem/ {
- proxy_redirect off;
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- client_max_body_size 1000m;
- proxy_read_timeout 3600s;#超时设置
- proxy_pass http://127.0.0.1:9800/;
- }
- location ^~/labSystem/admin/ {
- proxy_redirect off;
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- client_max_body_size 1000m;
- proxy_read_timeout 3600s;#超时设置
-
- proxy_pass http://127.0.0.1:81/labSystem/;
- }
- location /mqtt {
- proxy_pass http://127.0.0.1:1884;
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $remote_addr;
- proxy_http_version 1.1;
- proxy_set_header Upgrade $http_upgrade;
- proxy_set_header Connection "upgrade";
- proxy_set_header Sec-WebSocket-Protocol mqtt;
- }
- }
- }
|