[GH-ISSUE #657] Too many redirects #297

Closed
opened 2026-02-26 10:31:41 +03:00 by kerem · 2 comments
Owner

Originally created by @piiskop on GitHub (Sep 2, 2023).
Original GitHub issue: https://github.com/ONLYOFFICE/Docker-DocumentServer/issues/657

Do you want to request a feature or report a bug?
bug

What is the current behavior?
Too many redirects.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.
I installed the document server this way:

sudo docker run -i -t -d -p 112:80 -p 446:443 --restart=always -v /app/onlyoffice/DocumentServer/logs:/var/log/onlyoffice -v /app/onlyoffice/DocumentServer/data:/var/www/onlyoffice/Data -v /app/onlyoffice/DocumentServer/lib:/var/lib/onlyoffice -v /app/onlyoffice/DocumentServer/db:/var/lib/postgresql -e LETS_ENCRYPT_DOMAIN=documentserver.onlyoffice.ons.ee -e LETS_ENCRYPT_MAIL=kalmer@ons.ee -e JWT_SECRET=my_jwt_secret onlyoffice/documentserver

The configuration file for nginx has the following content:

server {
       server_name documentserver.onlyoffice.ons.ee;
       location / {
                proxy_connect_timeout   1200;
                proxy_send_timeout      1200;
                proxy_read_timeout      1200;
                send_timeout            1200;
                proxy_set_header        X-Real-IP $remote_addr;
                proxy_set_header        X-Forwarded-For $remote_addr;
                proxy_set_header        Host $host;
                proxy_pass              http://localhost:112;
                proxy_set_header        Upgrade $http_upgrade;
                proxy_set_header        Connection "Upgrade";
                proxy_set_header        X-Forwarded-Proto $scheme;
                add_header              X-Frontent-Host $host;
                client_max_body_size    1024m;
        }


    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/documentserver.onlyoffice.ons.ee/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/documentserver.onlyoffice.ons.ee/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 = documentserver.onlyoffice.ons.ee) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


       server_name documentserver.onlyoffice.ons.ee;
    listen 80;
    return 404; # managed by Certbot


}

It worked for a day but after restarting the machine, it does not work anymore. Removing the container and reinstalling the image did not make a difference. If I access https://documentserver.onlyoffice.ons.ee/ then I get:

This page isn’t workingdocumentserver.onlyoffice.ons.ee redirected you too many times.
Try clearing your cookies.
ERR_TOO_MANY_REDIRECTS

What is the expected behavior?

The document server works.

Did this work in previous versions of DocumentServer?

Irrelevant.

DocumentServer Docker tag:

REPOSITORY TAG IMAGE ID CREATED SIZE
onlyoffice/documentserver latest 2e2042083288 5 weeks ago 3.05GB

blissful_buck

Host Operating System:

Ubuntu 22.04.3 LTS

Originally created by @piiskop on GitHub (Sep 2, 2023). Original GitHub issue: https://github.com/ONLYOFFICE/Docker-DocumentServer/issues/657 **Do you want to request a *feature* or report a *bug*?** *bug* **What is the current behavior?** Too many redirects. **If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.** I installed the document server this way: `sudo docker run -i -t -d -p 112:80 -p 446:443 --restart=always -v /app/onlyoffice/DocumentServer/logs:/var/log/onlyoffice -v /app/onlyoffice/DocumentServer/data:/var/www/onlyoffice/Data -v /app/onlyoffice/DocumentServer/lib:/var/lib/onlyoffice -v /app/onlyoffice/DocumentServer/db:/var/lib/postgresql -e LETS_ENCRYPT_DOMAIN=documentserver.onlyoffice.ons.ee -e LETS_ENCRYPT_MAIL=kalmer@ons.ee -e JWT_SECRET=my_jwt_secret onlyoffice/documentserver` The configuration file for *nginx* has the following content: ``` server { server_name documentserver.onlyoffice.ons.ee; location / { proxy_connect_timeout 1200; proxy_send_timeout 1200; proxy_read_timeout 1200; send_timeout 1200; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header Host $host; proxy_pass http://localhost:112; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; proxy_set_header X-Forwarded-Proto $scheme; add_header X-Frontent-Host $host; client_max_body_size 1024m; } listen 443 ssl; # managed by Certbot ssl_certificate /etc/letsencrypt/live/documentserver.onlyoffice.ons.ee/fullchain.pem; # managed by Certbot ssl_certificate_key /etc/letsencrypt/live/documentserver.onlyoffice.ons.ee/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 = documentserver.onlyoffice.ons.ee) { return 301 https://$host$request_uri; } # managed by Certbot server_name documentserver.onlyoffice.ons.ee; listen 80; return 404; # managed by Certbot } ``` It worked for a day but after restarting the machine, it does not work anymore. Removing the container and reinstalling the image did not make a difference. If I access https://documentserver.onlyoffice.ons.ee/ then I get: > This page isn’t workingdocumentserver.onlyoffice.ons.ee redirected you too many times. > [Try clearing your cookies](https://support.google.com/chrome?p=rl_error&hl=en-US). > ERR_TOO_MANY_REDIRECTS **What is the expected behavior?** The document server works. **Did this work in previous versions of DocumentServer?** Irrelevant. **DocumentServer Docker tag:** REPOSITORY TAG IMAGE ID CREATED SIZE onlyoffice/documentserver latest 2e2042083288 5 weeks ago 3.05GB blissful_buck **Host Operating System:** Ubuntu 22.04.3 LTS
kerem 2026-02-26 10:31:41 +03:00
  • closed this issue
  • added the
    duplicate
    label
Author
Owner

@igwyd commented on GitHub (Oct 12, 2023):

Hello @piiskop, sorry for the late reply. To get certificates from letsencrypt using variables in docker you will have to use 80 and 443 ports, because letsencrypt uses these ports.
Duplicate of #347

<!-- gh-comment-id:1759196310 --> @igwyd commented on GitHub (Oct 12, 2023): Hello @piiskop, sorry for the late reply. To get certificates from letsencrypt using variables in docker you will have to use 80 and 443 ports, because letsencrypt uses these ports. Duplicate of #347
Author
Owner

@Rita-Bubnova commented on GitHub (Oct 12, 2023):

I close this issue. Feel free to comment or reopen it if you got further questions.

<!-- gh-comment-id:1759584232 --> @Rita-Bubnova commented on GitHub (Oct 12, 2023): I close this issue. Feel free to comment or reopen it if you got further questions.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Docker-DocumentServer-ONLYOFFICE#297
No description provided.