Too many redirects when reverse proxying to Discourse from a different server

(Jeff Yeon) #1

I set up Discourse on the domain and i’m trying to make it so that (different machine) proxies the request to I’ve already set up the subdirectory according to Subfolder support with Docker and it’s working fine. e.g works.

However I’m struggling to set up the proxy on Nginx on the server that is proxying.

location ~/discuss(.*)$ {
    proxy_set_header X-Real-IP  $remote_addr;
    proxy_set_header X-Forwarded-For $remote_addr;
    proxy_set_header Host $host;
    # I also tried this among others
    # proxy_pass$1;

It’s hitting the Discourse server according to top but i’m getting a ERR_TOO_MANY_REDIRECTS error attempting to go to I’m 90% sure it’s not an Nginx problem because the request is coming in from the Discourse side, but it’s causes too many redirects. I’m guessing it has something to do with the subdirectory redirect on Discourse. E.g. I go to and it redirects to