From c40002ca5bcb4951fd6be4c95346c20aaef252f2 Mon Sep 17 00:00:00 2001 From: akun <957746831@qq.com> Date: Fri, 12 Apr 2024 18:27:27 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4nginx?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf-ui/nginx.conf | 38 ++++++++++++++------------------------ 1 file changed, 14 insertions(+), 24 deletions(-) diff --git a/sf-ui/nginx.conf b/sf-ui/nginx.conf index 17defe3..b701f98 100644 --- a/sf-ui/nginx.conf +++ b/sf-ui/nginx.conf @@ -11,41 +11,31 @@ http { sendfile on; keepalive_timeout 65; - gzip on; + #gzip on; server { listen 80; server_name localhost; + charset utf-8; location / { - root /app/nginx/html; - index index.html; - # try_files $uri $uri/ /index.html; - if ($request_filename ~* ^.*?.(html|htm)$) { - add_header Cache-Control "private, no-store, no-cache, must-revalidate, proxy-revalidate"; - } + root /app/nginx/html; + try_files $uri $uri/ @router; + index index.html index.htm; + } + + location @router { + rewrite ^.*$ /index.html last; } location /stage-api/ { - proxy_ignore_client_abort on; - client_max_body_size 600M; - client_body_buffer_size 600M; - 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 X-NginX-Proxy true; - add_header Access-Control-Allow-Origin $http_origin; - add_header Access-Control-Allow-Method GET,POST,OPTIONS; - add_header Access-Control-Allow-Headers version,location,lat,long,device,did,macaws_sign; - proxy_pass http://172.24.0.2:7781/; + proxy_set_header Host $http_host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header REMOTE-HOST $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_pass http://zt-sac-java:7781/; } - - location /file { - alias /file; - } - - #error_page 404 /404.html; error_page 500 502 503 504 /50x.html; location = /50x.html { root html;