nginx重新按职能拆分成desktop网站、mobile网站、gateway网关 Former-commit-id: edcf3a0ef3f3466e35e383e0a415490d9b854bf3 Former-commit-id: ec4049193f63a22fbc8a093617b9980e9eeb4edeTSXN
parent
86f91bc64d
commit
0388dd453a
@ -1,32 +1,12 @@
|
||||
#docker-compose up -d
|
||||
version: "3.8"
|
||||
services:
|
||||
webmvc:
|
||||
image: nginx:1.18
|
||||
restart: always
|
||||
environment:
|
||||
TZ: "Asia/Shanghai"
|
||||
ports:
|
||||
- 5001:80
|
||||
desktop:
|
||||
volumes:
|
||||
- ../../../../projects/WebMVC/wwwroot:/usr/share/nginx/html
|
||||
- ./docker/log/webmvc:/var/log/nginx
|
||||
networks:
|
||||
default:
|
||||
ipv4_address: 172.172.0.110
|
||||
webspa:
|
||||
image: nginx:1.18
|
||||
restart: always
|
||||
environment:
|
||||
TZ: "Asia/Shanghai"
|
||||
ports:
|
||||
- 5002:80
|
||||
- ../../../../projects/WebMVC/wwwroot:/usr/share/nginx/html
|
||||
mobile:
|
||||
volumes:
|
||||
- ../../../../projects/WebSPA/wwwroot:/usr/share/nginx/html
|
||||
- ./docker/log/webspa:/var/log/nginx
|
||||
networks:
|
||||
default:
|
||||
ipv4_address: 172.172.0.120
|
||||
nginx:
|
||||
gateway:
|
||||
volumes:
|
||||
- ./docker/conf/nginx/nginx.development.conf:/etc/nginx/nginx.conf
|
||||
- ./docker/conf/gateway/nginx.development.conf:/etc/nginx/nginx.conf
|
@ -0,0 +1,74 @@
|
||||
#user nobody;
|
||||
worker_processes 1;
|
||||
|
||||
#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;
|
||||
sendfile on;
|
||||
keepalive_timeout 65;
|
||||
|
||||
server {
|
||||
listen 0.0.0.0:80;
|
||||
server_name localhost;
|
||||
|
||||
location / {
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
if ($http_user_agent ~* "(mobile|android|ipad|iphone|ipod|tablet)") {
|
||||
return 302 http://$host:81/;
|
||||
}
|
||||
}
|
||||
|
||||
location ^~ /dfs/ {
|
||||
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://172.172.0.12;
|
||||
}
|
||||
|
||||
location ^~ /live/ {
|
||||
proxy_pass http://172.172.0.12;
|
||||
}
|
||||
|
||||
location ^~ /video/ {
|
||||
proxy_pass http://172.172.0.12;
|
||||
}
|
||||
|
||||
location ^~ /influxdb/ {
|
||||
proxy_pass http://172.172.0.12;
|
||||
}
|
||||
|
||||
location ^~ /UserCenter/ {
|
||||
proxy_pass http://172.172.0.12;
|
||||
}
|
||||
|
||||
location ^~ /IoTCenter/ {
|
||||
proxy_pass http://172.172.0.12;
|
||||
}
|
||||
|
||||
location ^~ /IoTCenter/hub {
|
||||
proxy_pass http://172.172.0.12;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
}
|
||||
|
||||
location ^~ /JobServer/ {
|
||||
proxy_pass http://172.172.0.12;
|
||||
}
|
||||
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
location = /50x.html {
|
||||
root html;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,71 @@
|
||||
#user nobody;
|
||||
worker_processes 1;
|
||||
|
||||
#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;
|
||||
sendfile on;
|
||||
keepalive_timeout 65;
|
||||
|
||||
server {
|
||||
listen 0.0.0.0:80;
|
||||
server_name localhost;
|
||||
|
||||
location / {
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
}
|
||||
|
||||
location ^~ /dfs/ {
|
||||
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://172.172.0.12;
|
||||
}
|
||||
|
||||
location ^~ /live/ {
|
||||
proxy_pass http://172.172.0.12;
|
||||
}
|
||||
|
||||
location ^~ /video/ {
|
||||
proxy_pass http://172.172.0.12;
|
||||
}
|
||||
|
||||
location ^~ /influxdb/ {
|
||||
proxy_pass http://172.172.0.12;
|
||||
}
|
||||
|
||||
location ^~ /UserCenter/ {
|
||||
proxy_pass http://172.172.0.12;
|
||||
}
|
||||
|
||||
location ^~ /IoTCenter/ {
|
||||
proxy_pass http://172.172.0.12;
|
||||
}
|
||||
|
||||
location ^~ /IoTCenter/hub {
|
||||
proxy_pass http://172.172.0.12;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
}
|
||||
|
||||
location ^~ /JobServer/ {
|
||||
proxy_pass http://172.172.0.12;
|
||||
}
|
||||
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
location = /50x.html {
|
||||
root html;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in new issue