Browse Source

修改端口

master
刘忱 1 year ago
parent
commit
3119ef1f94
  1. 6
      Dockerfile_prod
  2. 8
      nginx.conf
  3. 6
      nginx_prod.conf

6
Dockerfile_prod

@ -1,7 +1,7 @@
# 设置基础镜像 # 设置基础镜像
FROM win-nginx FROM win-nginx
WORKDIR /opt/eam-pda WORKDIR /opt/tianhe-pda
COPY nginx_prod.conf /usr/local/nginx/conf/nginx.conf COPY nginx_prod.conf /usr/local/nginx/conf/nginx.conf
# 将dist/build/h5/文件中的内容复制到 /opt/eam-pda 这个目录下面 # 将dist/build/h5/文件中的内容复制到 /opt/tianhe-pda 这个目录下面
COPY dist/build/h5/ /opt/eam-pda COPY dist/build/h5/ /opt/tianhe-pda

8
nginx.conf

@ -26,15 +26,15 @@ http {
gzip_types text/plain application/javascript text/css application/xml text/javascript image/jpeg image/gif image/png; gzip_types text/plain application/javascript text/css application/xml text/javascript image/jpeg image/gif image/png;
gzip_vary on; gzip_vary on;
gzip_disable "MSIE [1-6]\."; gzip_disable "MSIE [1-6]\.";
upstream eam { upstream tianhe {
server localhost:90 weight=10 max_fails=3 fail_timeout=10s; server localhost:90 weight=10 max_fails=3 fail_timeout=10s;
} }
server { server {
listen 82; listen 82;
server_name_in_redirect off; server_name_in_redirect off;
server_name dev.ccwin-in.com; server_name _;
location /api/ { location /api/ {
proxy_pass http://eam/; proxy_pass http://tianhe/;
proxy_next_upstream http_500 http_502 http_503 http_504 error timeout invalid_header; proxy_next_upstream http_500 http_502 http_503 http_504 error timeout invalid_header;
proxy_set_header X-Forwared-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwared-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host; proxy_set_header Host $http_host;
@ -46,7 +46,7 @@ http {
proxy_cache_valid 200 304 12h; proxy_cache_valid 200 304 12h;
proxy_cache_key $host$uri$is_args$args; proxy_cache_key $host$uri$is_args$args;
try_files $uri $uri/ /index.html; try_files $uri $uri/ /index.html;
root /opt/eam-pda; root /opt/tianhe-pda;
index index.html index.htm; index index.html index.htm;
} }
} }

6
nginx_prod.conf

@ -26,7 +26,7 @@ http {
gzip_types text/plain application/javascript text/css application/xml text/javascript image/jpeg image/gif image/png; gzip_types text/plain application/javascript text/css application/xml text/javascript image/jpeg image/gif image/png;
gzip_vary on; gzip_vary on;
gzip_disable "MSIE [1-6]\."; gzip_disable "MSIE [1-6]\.";
upstream eam { upstream tianhe {
server localhost:90 weight=10 max_fails=3 fail_timeout=10s; server localhost:90 weight=10 max_fails=3 fail_timeout=10s;
} }
server { server {
@ -34,8 +34,8 @@ http {
server_name_in_redirect off; server_name_in_redirect off;
server_name _; server_name _;
location /api/ { location /api/ {
proxy_pass http://eam/; proxy_pass http://tianhe/;
proxy_next_upstream http_500 http_502 http_503 http_504 error timeout invalid_header; tianhe http_500 http_502 http_503 http_504 error timeout invalid_header;
proxy_set_header X-Forwared-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwared-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host; proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;

Loading…
Cancel
Save