fix: hardcode upstream address in proxy_pass to avoid nginx variable URI rewrite issue

This commit is contained in:
2026-04-26 22:30:18 +08:00
parent b10bc5b0fb
commit 8c583acfcc
2 changed files with 2 additions and 5 deletions
+1 -3
View File
@@ -8,8 +8,6 @@ server {
ssl_certificate /etc/letsencrypt/live/moicen.com/fullchain.pem; # managed by Certbot ssl_certificate /etc/letsencrypt/live/moicen.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/moicen.com/privkey.pem; # managed by Certbot ssl_certificate_key /etc/letsencrypt/live/moicen.com/privkey.pem; # managed by Certbot
set $huiwing_htyproc_rust "127.0.0.1:3004"; # huiwing 仓库 htyprocRust
location /api/v2/proc/ { location /api/v2/proc/ {
add_header Access-Control-Allow-Origin $http_origin always; add_header Access-Control-Allow-Origin $http_origin always;
add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS' always; add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS' always;
@@ -19,6 +17,6 @@ server {
if ($request_method = 'OPTIONS') { if ($request_method = 'OPTIONS') {
return 200; return 200;
} }
proxy_pass http://$huiwing_htyproc_rust/api/v1/proc/; proxy_pass http://127.0.0.1:3004/api/v1/proc/;
} }
} }
+1 -2
View File
@@ -10,7 +10,6 @@ server {
ssl_certificate /etc/letsencrypt/live/moicen.com/fullchain.pem; # managed by Certbot ssl_certificate /etc/letsencrypt/live/moicen.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/moicen.com/privkey.pem; # managed by Certbot ssl_certificate_key /etc/letsencrypt/live/moicen.com/privkey.pem; # managed by Certbot
set $huiwing_htyts_rust "127.0.0.1:3003"; # huiwing 仓库 htytsRust
set $htyuc "http://127.0.0.1:3000"; #htyuc host set $htyuc "http://127.0.0.1:3000"; #htyuc host
set $resty_loc "/usr/local/openresty"; set $resty_loc "/usr/local/openresty";
@@ -23,7 +22,7 @@ server {
if ($request_method = 'OPTIONS') { if ($request_method = 'OPTIONS') {
return 200; return 200;
} }
proxy_pass http://$huiwing_htyts_rust/api/v1/ts/; proxy_pass http://127.0.0.1:3003/api/v1/ts/;
} }
} }