调整nginx

This commit is contained in:
akun 2024-04-12 18:03:51 +08:00
parent fbb2014c2f
commit af78ff6819

View File

@ -11,31 +11,41 @@ http {
sendfile on; sendfile on;
keepalive_timeout 65; keepalive_timeout 65;
#gzip on; gzip on;
server { server {
listen 80; listen 80;
server_name localhost; server_name localhost;
charset utf-8;
location / { location / {
root /app/nginx/html; root /app/nginx/html;
try_files $uri $uri/ @router; index index.html;
index index.html index.htm; # try_files $uri $uri/ /index.html;
} if ($request_filename ~* ^.*?.(html|htm)$) {
add_header Cache-Control "private, no-store, no-cache, must-revalidate, proxy-revalidate";
location @router { }
rewrite ^.*$ /index.html last;
} }
location /stage-api/ { location /stage-api/ {
proxy_set_header Host $http_host; proxy_ignore_client_abort on;
proxy_set_header X-Real-IP $remote_addr; client_max_body_size 600M;
proxy_set_header REMOTE-HOST $remote_addr; client_body_buffer_size 600M;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $host;
proxy_pass http://192.168.1.23:22009/; 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://zt-sac-java:7781/;
} }
location /file {
alias /file;
}
#error_page 404 /404.html;
error_page 500 502 503 504 /50x.html; error_page 500 502 503 504 /50x.html;
location = /50x.html { location = /50x.html {
root html; root html;