Unable to get reverse proxy setup working with nginx

IIS, Apache
Post Reply
MShekow
Posts: 1
Joined: Tue Mar 17, 2020 6:29 pm

Unable to get reverse proxy setup working with nginx

Post by MShekow » Tue Mar 17, 2020 6:47 pm

Hi,

I'm running OnlyOffice CE using the official docker-compose.yml (I threw out a few things, and set the port of the community server to 7676 instead of 80).

My nginx is terminating a HTTPS address, and I want to reverse proxy "https://myhost.com/onlyoffice" to the server running HTTP on port 7676.

I've followed the instructions on page https://helpcenter.onlyoffice.com/serve ... proxy.aspx - that is, I've considered https://github.com/ONLYOFFICE/document- ... -path.conf

The relevant parts of my nginx conf are:

Code: Select all

map $http_x_forwarded_proto $the_scheme {
     default $http_x_forwarded_proto;
     "" $scheme;
}

map $http_x_forwarded_host $the_host {
    default $http_x_forwarded_host;
    "" $host;
}

location /onlyoffice/ {
                proxy_pass http://localhost:7676/;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "upgrade";
                proxy_set_header X-Forwarded-Host $the_host/onlyoffice;
                proxy_set_header X-Forwarded-Proto $the_scheme;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }
However, whenever I go to https://myhost.com/onlyoffice (or https://myhost.com/onlyoffice/ ) in the browser, it will redirect me to https://myhost.com/auth.aspx which results in HTTP status code 404.

Any ideas?

Alexandre
Posts: 110
Joined: Thu Dec 12, 2019 11:08 am

Re: Unable to get reverse proxy setup working with nginx

Post by Alexandre » Thu Mar 26, 2020 7:45 am

Hello Mshekow.
Unfortunately, we don’t have ready-to-go solution for you. Described examples are valid only for Document Server (not portal installation such as in your case).
Nonetheless, we support all standard headers for proxies.

pepinal
Posts: 1
Joined: Mon May 11, 2020 8:39 am

Re: Unable to get reverse proxy setup working with nginx

Post by pepinal » Mon May 11, 2020 8:42 am

Hello
I have exactly the same problem.
Have you managed to find a solution?

Cheers

Carl
Posts: 354
Joined: Thu Apr 12, 2018 10:00 am

Re: Unable to get reverse proxy setup working with nginx

Post by Carl » Tue May 12, 2020 7:31 am

Hello pepinal,

You have tried to post this message in two different threads. Could you please describe the issue in more details?

Post Reply