Comment on nginx reverse proxy using subpaths help

CameronDev@programming.dev ⁨1⁩ ⁨year⁩ ago

This is part of my config that does something similar, hopefully it helps?:

location /dynmap {
        rewrite ^/dynmap/(.*) /$1 break;
        proxy_pass http://192.168.1.100:8123/;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $host$uri;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;        proxy_set_header X-NginX-Proxy true;
        proxy_cache_key "$host$uri";
        proxy_cache_valid 200 302 60m;
        proxy_cache_valid 404     10m;
        proxy_cache_use_stale error timeout invalid_header updating http_500 http_503 http_504;
        proxy_connect_timeout 10;
        index  index.html index.htm;
    }
    location /bluemap {
        rewrite ^/bluemap/(.*) /$1 break;
        proxy_pass http://192.168.1.100:8100/;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $host$uri;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;        proxy_set_header X-NginX-Proxy true;
        proxy_cache_key "$host$uri";
        proxy_cache_valid 200 302 60m;
        proxy_cache_valid 404     10m;
        proxy_cache_use_stale error timeout invalid_header updating http_500 http_503 http_504;
        proxy_connect_timeout 10;
        index  index.html index.htm;
    }

source
Sort:hotnewtop