Score:0

Directory redirection issue with nginx set as reverse proxy

in flag

I have configured the server through Reverse Foloxy as follows:

Nginx reverse proxy(SSL Termination) - Varnish cache - Nginx web server(8080 port)

However, it has the following problems: For example, if you go to https://www.example.com/static (this is an example only, your domain is not my site), you will be redirected to http://www.example.com:8080/static/ . It is the same when accessing not only staic but also other directories. I am wondering how to do something like nginx.conf etc to solve this problem.

sv flag
Welcome to ServerFault. Please post the existing configuration of Nginx and Varnish to understand what's going on.
drookie avatar
za flag
Nginx -> varnish -> nginx ? Jeez. Pour some gas on and set it on fire. Then add an nginx cache of any sort on the last instance.
anon avatar
in flag
@drookie Nginx on the front end is a reverse proxy that acts as an SSL termination for varnish that doesn't support SSL.
djdomi avatar
za flag
remove vanish at ALL, nginx do and does the same or better
Egidijus avatar
nz flag
Varnish and NGINX are both fantastic software. @anon please share your FRONT SSL terminator nginx config, I suspect you are missing a character or two. Also, do you see expected pages with the extra :8080 ports ?
Ivan Shatsky avatar
gr flag
Does this answer your question? [Hide port in Nginx reverse proxy redirection](https://serverfault.com/questions/627305/hide-port-in-nginx-reverse-proxy-redirection)
Score:0
in flag
port_in_redirect off;

Nginx web server (8080 port) It was solved by adding the above setting to the corresponding server block.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.