Skip to content

Reverse proxy requires Host to be set in headers #2156

Closed Answered by grisu48
grisu48 asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, that was it! I needed to set the Host header in my nginx configuration:

location / {
    proxy_pass http://10.88.0.12/;   # Container IP
    proxy_set_header Host            $host;
    proxy_set_header X-Forwarded-For $remote_addr;
    proxy_set_header X-Forwarded-Proto https;
    client_max_body_size 128M;
}

The important setting is the Host setting, the X-Forwarded-For is not strictly required to work. So in addition to the APP_URL also the Host HTTP header needs to be set correctly. This was not an issue in v4.

I also needed to set APP_FORCE_HTTPS=true in the .env settings but that's a different issue and might depend on your configuration.

EDIT: I added proxy_set_header X-Forward…

Replies: 1 comment 14 replies

Comment options

You must be logged in to vote
14 replies
@grisu48
Comment options

@ildyria
Comment options

@grisu48
Comment options

Answer selected by grisu48
@grisu48
Comment options

@ildyria
Comment options

@grisu48
Comment options

@grisu48
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants