fix(infra): use ^~ prefix location for /api and /ws to match without trailing slash
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
2b8d1ac703
commit
cbe63809dd
@@ -15,8 +15,8 @@ server {
|
||||
listen 80;
|
||||
server_name imphnen.asepharyana.my.id;
|
||||
|
||||
# API proxy
|
||||
location /api/ {
|
||||
# API proxy — matches /api and /api/*
|
||||
location ^~ /api {
|
||||
proxy_pass http://backend;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
@@ -24,8 +24,8 @@ server {
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
|
||||
# WebSocket proxy
|
||||
location /ws {
|
||||
# WebSocket proxy — matches /ws and /ws/*
|
||||
location ^~ /ws {
|
||||
proxy_pass http://backend;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
|
||||
Reference in New Issue
Block a user