Skip to content

Commit

Permalink
🔧 update nginx.conf
Browse files Browse the repository at this point in the history
  • Loading branch information
lazhenyi committed Nov 19, 2024
1 parent d8fee33 commit e877a6b
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions script/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,21 @@ http {
try_files $uri $uri/ /index.html;
gzip_static on;
add_header 'Access-Control-Allow-Origin' '*';
location /api {
location /api {
proxy_pass http://221.128.225.26:34513;
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-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-NginX-Proxy true;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
proxy_cache_bypass $http_upgrade;
proxy_change_origin on;
rewrite ^/api(.*)$ $1 break;
}
}
}

0 comments on commit e877a6b

Please sign in to comment.