I have one of many microsites that is hosted on a remote backend server as https://remote-server.mydomain.com/pdf
I’m trying to publish via Nginx proxy on a different location to keep things centralized with following config.
/etc/nginx/conf.d/backends.conf
upstream pdf-dev {
zone pdf-dev-service 256k;
server https://remote-server.mydomain.com;
}
/etc/nginx/conf.d/pdf.conf
location /dev/pdf {
proxy_pass https://pdf-dev/pdf;
}
Nginx can be reached via https://gateway.mydomain.com
When I hit the url https://gateway.mydomain.com/dev/pdf I get the microsite.
But then, the minute I hit the links inside the microsite, I’m getting served the subsequent URLs dropping ‘dev‘ part in the location. Like, if I click on ‘about’ in the loaded page, Nginx serves it as https://gateway.mydomain.com/pdf/about instead of https://gateway.mydomain.com/dev/pdf/about
Any way to retain the path /dev/pdf. Because we’re thinking of leveraging nginx to publish microsites from other environments like PAT and PROD.
I tried different config options available in different stack posts with no help.
Arun Ghanta is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.