Jump to content

nginx reverse proxy


Smilie

Recommended Posts

Hi,

I found quite many topics on how to configure nginx on the box hosting my forums.

In my setup I have another nginx reverse proxy in front to handle SSL.

Does anyone have any experience on which settings should be applied?

Currently I have this on my proxy:

server {
	server_name hostname.com;
	location / {
		proxy_set_header X-Forwarded-Host $host;
		proxy_set_header X-Forwarded-Server $host;
		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
		#proxy_set_header X-Forwarded-Proto https;
		#proxy_set_header X-Forwarded-Port 443;
		proxy_pass http://<ip>:<port>/;
	}

    listen 443 ssl; # managed by Certbot
    ssl_certificate /stuff/fullchain.pem; # managed by Certbot
    ssl_certificate_key /stuff/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}server {
    if ($host = hostname.com) {
        return 301 https://$host$request_uri;
    } # managed by Certbot

	server_name hostname.com
	listen *:80;
    return 404; # managed by Certbot
}

I have also updated the base_url in conf_global.php to point to the proxy server url.

For some reason, I keep getting redirected to the same site over and over, until the browser eventually gives up.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...