guys, need support / advice how to set up Document Server v5 (Docker version) with its embedded Nginx behind external Nginx?
DocumentServer (Docker) uses self-signed cert, HTTPS available on the port 18443
External Nginx provides valid SSL-cert and listens on the port 18445
I need the following schema to work properly:
Client -----> External Nginx (18445) -----> DocumentServer (Docker + Nginx) 18443
On the external Nginx I have the following config:
Code: Select all
upstream onlyoffice_node {
server 127.0.0.1:18443 weight=100 max_fails=5 fail_timeout=5;
}
server {
listen 18445 ssl;
ssl_certificate /etc/nginx/ssl/cert1.crt;
ssl_certificate_key /etc/nginx/ssl/cert1.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
client_max_body_size 100M;
location / {
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 600;
proxy_pass https://onlyoffice_node;
proxy_redirect https://$host/ https://$host:$server_port/; #fixes reedirect sent from the proxied server
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
#proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Remote-IP $remote_addr;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
Code: Select all
proxy_redirect https://$host/ https://$host:$server_port/;
Error in Browser console:
Code: Select all
Failed to load https://30x-dev1.app.ua/cache/files/ds1-db0-c03d-5a05198233ecdf1c04cc8636/Editor.bin/Editor.bin?md5=tLsTHuhLaAZaDlN0i6vj6g==&expires=1514438849&disposition=attachment&ooname=output.bin: Redirect from 'https://30x-dev1.app.ua/cache/files/ds1-db0-c03d-5a05198233ecdf1c04cc8636/Editor.bin/Editor.bin?md5=tLsTHuhLaAZaDlN0i6vj6g==&expires=1514438849&disposition=attachment&ooname=output.bin' to 'https://30x-dev1.app.ua/login.xhtml;appJSID=11826ff661e6858c998cfc3fe775' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://30x-dev1.app.ua:18445' is therefore not allowed access.
Also CORS is properly adjusted and without external Nginx everything works fine.
Appreciate any advice how to adjust external Nginx config! Thank you!