# deploy/nginx-snippet.conf # Add inside your existing TLS server block. # # The prefix is passed through UNCHANGED: no trailing slash on proxy_pass, # no rewrite. Paths are then identical on both sides, so there is nothing # to keep in sync between nginx and BASE_PATH. # Without this, https://host/maps (no trailing slash) never matches the block # below. It would also break , since relative URLs would # resolve against / instead. location = /maps { return 301 /maps/; } location /maps/ { proxy_pass http://127.0.0.1:8080; proxy_http_version 1.1; 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; } # GPX uploads: nginx defaults to client_max_body_size 1m, which rejects a # real track before the app ever sees it. Raised here only, not globally. location /maps/api/gpx/upload { client_max_body_size 25m; proxy_request_buffering off; proxy_pass http://127.0.0.1:8080; proxy_http_version 1.1; 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; }