#Nginx reverse proxy $HOST doesn't receive domain name

3 messages · Page 1 of 1 (latest)

jagged halo
#

I have 2 services one is the UI and one is the BACKEND. UI app is served using an nginx server which also acts as a reverse proxy for BACKEND request. My BACKEND uses the REQUEST_URL for some configuration. Normally to ensure that BACKEND picks up the REQUEST_URL correctly, the nginx reverse proxy configuration needs:

location /api {
    proxy_pass http://backend/api;
    proxy_set_header Host $host; # setting Host header
}

Problem here is that railway $host is a list of IPs not the actual UI configured domain. Current workaround is to set the host manually as an env variable.
Is there another header that contains the actual domain/host?

wicked scarab
#

Problem here is that railway $host is a list of IPs not the actual UI configured domain
Do you have a screenshot of Host header being a list of IPs?

jagged halo
#

I'll have to recreate the scenario