fix: hardcode upstream address in proxy_pass to avoid nginx variable URI rewrite issue
This commit is contained in:
@@ -8,8 +8,6 @@ server {
|
||||
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
|
||||
|
||||
set $huiwing_htyproc_rust "127.0.0.1:3004"; # huiwing 仓库 htyproc(Rust)
|
||||
|
||||
location /api/v2/proc/ {
|
||||
add_header Access-Control-Allow-Origin $http_origin always;
|
||||
add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS' always;
|
||||
@@ -19,6 +17,6 @@ server {
|
||||
if ($request_method = 'OPTIONS') {
|
||||
return 200;
|
||||
}
|
||||
proxy_pass http://$huiwing_htyproc_rust/api/v1/proc/;
|
||||
proxy_pass http://127.0.0.1:3004/api/v1/proc/;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-2
@@ -10,7 +10,6 @@ server {
|
||||
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
|
||||
|
||||
set $huiwing_htyts_rust "127.0.0.1:3003"; # huiwing 仓库 htyts(Rust)
|
||||
set $htyuc "http://127.0.0.1:3000"; #htyuc host
|
||||
set $resty_loc "/usr/local/openresty";
|
||||
|
||||
@@ -23,7 +22,7 @@ server {
|
||||
if ($request_method = 'OPTIONS') {
|
||||
return 200;
|
||||
}
|
||||
proxy_pass http://$huiwing_htyts_rust/api/v1/ts/;
|
||||
proxy_pass http://127.0.0.1:3003/api/v1/ts/;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user