From 73f974ba5ed2e01c3bf756ee77f2b0bdf57b049c Mon Sep 17 00:00:00 2001 From: wanggang <76527413@qq.com> Date: Mon, 10 Aug 2020 17:00:15 +0800 Subject: [PATCH] 1.0.0.0810d3 Former-commit-id: 14d3d72582a810f4ad572d0e860f32af75a59339 Former-commit-id: e42436b103971fc0a73d469be4f61f141ec46688 --- projects/Version.cs | 2 +- .../publish/docker-compose.override.yml | 5 +- .../linux-x64/publish/docker-compose.prod.yml | 5 ++ .../src/linux-x64/publish/docker-compose.yml | 2 +- .../publish/docker/conf/gateway/nginx.conf | 18 ++--- .../conf/gateway/nginx.development.conf | 71 +++++++++++++++++++ 6 files changed, 91 insertions(+), 12 deletions(-) create mode 100644 publish/src/linux-x64/publish/docker/conf/gateway/nginx.development.conf diff --git a/projects/Version.cs b/projects/Version.cs index ad9cfa4e..5c953c26 100644 --- a/projects/Version.cs +++ b/projects/Version.cs @@ -1,4 +1,4 @@ using System.Reflection; [assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyInformationalVersion("1.0.0.0810d2")] \ No newline at end of file +[assembly: AssemblyInformationalVersion("1.0.0.0810d3")] \ No newline at end of file diff --git a/publish/src/linux-x64/publish/docker-compose.override.yml b/publish/src/linux-x64/publish/docker-compose.override.yml index f3a252ed..1f4156d6 100644 --- a/publish/src/linux-x64/publish/docker-compose.override.yml +++ b/publish/src/linux-x64/publish/docker-compose.override.yml @@ -4,4 +4,7 @@ services: website: volumes: - ../../../../projects/WebMVC/wwwroot:/usr/share/nginx/html/desktop - - ../../../../projects/WebSPA/wwwroot:/usr/share/nginx/html/mobile \ No newline at end of file + - ../../../../projects/WebSPA/wwwroot:/usr/share/nginx/html/mobile + gateway: + volumes: + - ./docker/conf/gateway/nginx.development.conf:/etc/nginx/nginx.conf \ No newline at end of file diff --git a/publish/src/linux-x64/publish/docker-compose.prod.yml b/publish/src/linux-x64/publish/docker-compose.prod.yml index 4cd14062..bbbebd2a 100644 --- a/publish/src/linux-x64/publish/docker-compose.prod.yml +++ b/publish/src/linux-x64/publish/docker-compose.prod.yml @@ -53,3 +53,8 @@ services: networks: default: ipv4_address: 172.172.0.90 + gateway: + depends_on: + - usercenter + - iotcenter + - jobserver diff --git a/publish/src/linux-x64/publish/docker-compose.yml b/publish/src/linux-x64/publish/docker-compose.yml index accd5891..f9e54b47 100644 --- a/publish/src/linux-x64/publish/docker-compose.yml +++ b/publish/src/linux-x64/publish/docker-compose.yml @@ -44,7 +44,7 @@ services: ports: - 8000:80 volumes: - - ./docker/conf/gateway/nginx.development.conf:/etc/nginx/nginx.conf + - ./docker/conf/gateway/nginx.conf:/etc/nginx/nginx.conf - ./docker/log/gateway:/var/log/nginx networks: default: diff --git a/publish/src/linux-x64/publish/docker/conf/gateway/nginx.conf b/publish/src/linux-x64/publish/docker/conf/gateway/nginx.conf index 07f33135..eca5ba79 100644 --- a/publish/src/linux-x64/publish/docker/conf/gateway/nginx.conf +++ b/publish/src/linux-x64/publish/docker/conf/gateway/nginx.conf @@ -22,45 +22,45 @@ http { location / { root /usr/share/nginx/html; - index index.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://host.docker.internal:9000/; + proxy_pass http://172.172.0.20:9000/; } location ^~ /live/ { - proxy_pass http://host.docker.internal:8080/live/; + proxy_pass http://172.172.0.60:8080/live/; } location ^~ /video/ { - proxy_pass http://host.docker.internal:8080/video/; + proxy_pass http://172.172.0.60:8080/video/; } location ^~ /influxdb/ { - proxy_pass http://host.docker.internal:8086/; + proxy_pass http://172.172.0.50:8086/; } location ^~ /UserCenter/ { - proxy_pass http://host.docker.internal:8010/UserCenter/; + proxy_pass http://172.172.0.70:8010/UserCenter/; } location ^~ /IoTCenter/ { - proxy_pass http://host.docker.internal:8011/IoTCenter/; + proxy_pass http://172.172.0.80:8011/IoTCenter/; } location ^~ /IoTCenter/hub { - proxy_pass http://host.docker.internal:8011/IoTCenter/hub; + proxy_pass http://172.172.0.80:8011/IoTCenter/hub; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } location ^~ /JobServer/ { - proxy_pass http://host.docker.internal:8013/JobServer/; + proxy_pass http://172.172.0.90:8013/JobServer/; } error_page 500 502 503 504 /50x.html; diff --git a/publish/src/linux-x64/publish/docker/conf/gateway/nginx.development.conf b/publish/src/linux-x64/publish/docker/conf/gateway/nginx.development.conf new file mode 100644 index 00000000..96248629 --- /dev/null +++ b/publish/src/linux-x64/publish/docker/conf/gateway/nginx.development.conf @@ -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://host.docker.internal:9000/; + } + + location ^~ /live/ { + proxy_pass http://host.docker.internal:8080/live/; + } + + location ^~ /video/ { + proxy_pass http://host.docker.internal:8080/video/; + } + + location ^~ /influxdb/ { + proxy_pass http://host.docker.internal:8086/; + } + + location ^~ /UserCenter/ { + proxy_pass http://host.docker.internal:8010/UserCenter/; + } + + location ^~ /IoTCenter/ { + proxy_pass http://host.docker.internal:8011/IoTCenter/; + } + + location ^~ /IoTCenter/hub { + proxy_pass http://host.docker.internal:8011/IoTCenter/hub; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + } + + location ^~ /JobServer/ { + proxy_pass http://host.docker.internal:8013/JobServer/; + } + + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root html; + } + } +} \ No newline at end of file