Skip to content

Nginx reverse proxy WITHOUT 80 and 443 port #6177

Answered by code-asher
txwdzxq asked this question in Q&A
Discussion options

You must be logged in to vote

To provide some more details, when origin is set it must be a valid URL and must match the host header (to prevent some cross-origin attacks).

So if the origin is http://test.domain.com then the host must be exactly test.domain.com. Or as another example if the origin is https://test.domain.com:1234 then the host must be exactly test.domain.com:1234. If the check fails then you get forbidden.

Usually proxy_set_header Host $host; is sufficient but you might need proxy_set_header Host $http_host; instead.

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@txwdzxq
Comment options

@code-asher
Comment options

@code-asher
Comment options

@code-asher
Comment options

Answer selected by txwdzxq
@txwdzxq
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
2 participants