Docker-CommunityServer: Document editing not working behind HTTPS reverse proxy

In my setup I use two containers for Community and Document servers. Everything worked fine. My docker-compose.yml file is as follows:

version: '2'
services:

  community:
    restart: always
    image: onlyoffice/communityserver
    depends_on:
      - document
    networks:
      default:
      proxy:
    volumes:
      - ./CommunityServer/data:/var/www/onlyoffice/Data
      - ./CommunityServer/mysql:/var/lib/mysql
      - ./CommunityServer/logs:/var/log/onlyoffice
      - ./DocumentServer/data:/var/www/onlyoffice/DocumentServerData
    environment:
      VIRTUAL_HOST: office.mydomain.com
      LETSENCRYPT_HOST: office.mydomain.com
      LETSENCRYPT_EMAIL: admin@mydomain.com
      DOCUMENT_SERVER_PORT_80_TCP_ADDR: document
    stdin_open: true
    tty: true

  document:
    restart: always
    image: onlyoffice/documentserver
    volumes:
      - ./DocumentServer/data:/var/www/onlyoffice/Data
      - ./DocumentServer/logs:/var/log/onlyoffice
    stdin_open: true
    tty: true

networks:
  proxy:
    external:
      name: nginxproxy_backend

I use nginx as a reverse proxy for my services. Recently I’ve set up HTTPS for all my services with Let’s Encrypt so config for each service looks like this:

upstream office.mydomain.com {
                ## Can be connect with "nginxproxy_backend" network
            # onlyoffice_community_1
            server 172.19.0.7:80;
}
server {
    server_name office.mydomain.com;
    listen 80 ;
    access_log /var/log/nginx/access.log vhost;
    return 301 https://$host$request_uri;
}
server {
    server_name office.mydomain.com;
    listen 443 ssl http2 ;
    access_log /var/log/nginx/access.log vhost;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA;
    ssl_prefer_server_ciphers on;
    ssl_session_timeout 5m;
    ssl_session_cache shared:SSL:50m;
    ssl_certificate /etc/nginx/certs/office.mydomain.com.crt;
    ssl_certificate_key /etc/nginx/certs/office.mydomain.com.key;
    ssl_dhparam /etc/nginx/certs/office.mydomain.com.dhparam.pem;
    add_header Strict-Transport-Security "max-age=31536000";
    include /etc/nginx/vhost.d/default;
    location / {
        proxy_pass http://office.mydomain.com;
    }
}

The problem I’m encountering is:

  1. open document for editing
  2. new tab appears and editor interface loaded
  3. content of document doesn’t load, loading banner spins forever
  4. in address bar there is warning about mixed content
  5. if i click “disable protection for now” page reloads and i immediately get “Unknown error” banner

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 16 (1 by maintainers)

Most upvoted comments

You need add some http headers when proxying request Try adding the following string into “location /” section

proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;