0

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.

anon
  • 1
  • 1
  • 1
    Welcome to ServerFault. Please post the existing configuration of Nginx and Varnish to understand what's going on. – Pothi Kalimuthu Oct 18 '21 at 04:09
  • 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. – drookie Oct 18 '21 at 05:18
  • @drookie Nginx on the front end is a reverse proxy that acts as an SSL termination for varnish that doesn't support SSL. – anon Oct 18 '21 at 05:21
  • 1
    remove vanish at ALL, nginx do and does the same or better – djdomi Oct 18 '21 at 07:27
  • 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 ? – Egidijus Oct 18 '21 at 23:11
  • Does this answer your question? [Hide port in Nginx reverse proxy redirection](https://serverfault.com/questions/627305/hide-port-in-nginx-reverse-proxy-redirection) – Ivan Shatsky Oct 29 '21 at 10:55

1 Answers1

0
port_in_redirect off;

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

anon
  • 1
  • 1