Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sharing the nginx files? #2

Open
danger89 opened this issue Feb 26, 2019 · 7 comments
Open

Sharing the nginx files? #2

danger89 opened this issue Feb 26, 2019 · 7 comments

Comments

@danger89
Copy link
Contributor

@danger89 danger89 commented Feb 26, 2019

Hi,

I'm using both Nextcloud & Libreoffice Online behind a Nginx reverse proxy webserver.

It means it could be handy to also share those Nginx site configuration files.
See attachments for my config files (do whatever you like with it 馃憤 ).

DISCLAIMER: I do not have LibreOffice still fully working actually. But my Nextcloud config does work really well.

Do you use any web-server on the host? Since for the production environment it is a good practice to use reverse proxy on top of the Nextcloud installation.

Regards,
Melroy van den Berg

Attachments: nginx_nextcloud_libreoffice_configs.zip

@danger89

This comment has been minimized.

Copy link
Contributor Author

@danger89 danger89 commented Feb 26, 2019

In my case I keep getting (using docker logs output of Libreoffice Online):

wsd-00015-00023 2019-02-26 18:05:16.300652 [ websrv_poll ] WRN  client - server version mismatch, disabling browser cache.| wsd/FileServer.cpp:279                                                         
wsd-00015-00023 2019-02-26 18:05:16.420838 [ websrv_poll ] WRN  FileServerRequestHandler: File not found: Invalid URI request: [/loleaflet/8a61a5302/branding.js].| wsd/FileServer.cpp:425                 
wsd-00015-00023 2019-02-26 18:05:16.647657 [ websrv_poll ] WRN  FileServerRequestHandler: File not found: Invalid URI request: [/loleaflet/8a61a5302/branding.js].| wsd/FileServer.cpp:425                 
wsd-00015-00023 2019-02-26 18:05:24.485582 [ websrv_poll ] WRN  client - server version mismatch, disabling browser cache.| wsd/FileServer.cpp:279                                                         
wsd-00015-00023 2019-02-26 18:05:24.620217 [ websrv_poll ] WRN  FileServerRequestHandler: File not found: Invalid URI request: [/loleaflet/8a61a5302/branding.js].| wsd/FileServer.cpp:425                 
wsd-00015-00023 2019-02-26 18:05:24.813640 [ websrv_poll ] WRN  FileServerRequestHandler: File not found: Invalid URI request: [/loleaflet/8a61a5302/branding.js].| wsd/FileServer.cpp:425                 
wsd-00015-00023 2019-02-26 18:05:25.868642 [ websrv_poll ] WRN  client - server version mismatch, disabling browser cache.| wsd/FileServer.cpp:279                                                         
wsd-00015-00023 2019-02-26 18:05:26.018280 [ websrv_poll ] WRN  FileServerRequestHandler: File not found: Invalid URI request: [/loleaflet/8a61a5302/branding.js].| wsd/FileServer.cpp:425                 
wsd-00015-00023 2019-02-26 18:05:26.212475 [ websrv_poll ] WRN  FileServerRequestHandler: File not found: Invalid URI request: [/loleaflet/8a61a5302/branding.js].| wsd/FileServer.cpp:425                 
@danger89

This comment has been minimized.

Copy link
Contributor Author

@danger89 danger89 commented Feb 26, 2019

I think Content Security Policy is to blame for this... Looking at the console logs.
See also: nextcloud/richdocuments#397 (comment)

@smehrbrodt

This comment has been minimized.

Copy link
Owner

@smehrbrodt smehrbrodt commented Feb 26, 2019

Ah nice, thanks for sharing your config!
There is some nginx example in the official LibreOffice Online repo: https://gerrit.libreoffice.org/plugins/gitiles/online/+/master/etc/nginx/loolwsd.conf

Maybe you want to provide a patch against that file?

@smehrbrodt

This comment has been minimized.

Copy link
Owner

@smehrbrodt smehrbrodt commented Feb 26, 2019

I do not have LibreOffice still fully working actually. But my Nextcloud config does work really well.

Does LO work without nextcloud, i.e. can you access something like
yourdomain:9980/loleaflet/dist/loleaflet.html?file_path=file:///opt/libreoffice/share/template/common/internal/idxexample.odt ?

@danger89

This comment has been minimized.

Copy link
Contributor Author

@danger89 danger89 commented Feb 27, 2019

Ah nice, thanks for sharing your config!
There is some nginx example in the official LibreOffice Online repo: https://gerrit.libreoffice.org/plugins/gitiles/online/+/master/etc/nginx/loolwsd.conf

Maybe you want to provide a patch against that file?

You're welcome! I tried this config as well, without any luck too bad.

Does LO work without nextcloud, i.e. can you access something like
yourdomain:9980/loleaflet/dist/loleaflet.html?file_path=file:///opt/libreoffice/share/template/common/internal/idxexample.odt ?

I can try. Atleast the admin panel does work flawlessly:
https://myserver.domain.com/loleaflet/dist/admin/admin.html

@ruby1126

This comment has been minimized.

Copy link

@ruby1126 ruby1126 commented Apr 1, 2019

鎴戜笉鏄娇鐢╪ginx锛屼笉閬庢湁灏噇ibreoffice online寤虹疆鎴愬姛锛宒ocker-compose.yml锛屽弮鑰冧竴涓

version: '2.1'

services:
  online:
	image: libreoffice/online:master
	environment:
	  domain: <cloud.domain.tld>      
	  username: admin
	  password: admin
	  extra_params: --o:ssl.enable=false
	  DONT_GEN_SSL_CERT: 1
	volumes:
	  - config-volume:/etc/loolwsd
	cap_add:
	  - MKNOD
	ports:
	  - 9980:9980
	restart:
	  unless-stopped
	networks:
	  - proxy-tier      

  db:
	image: mariadb
	restart: always
	ports:
	  - 3306:3306
	environment:
	  MYSQL_ROOT_PASSWORD: root      
	  MYSQL_DATABASE: nextcloud
	  MYSQL_USER: nextcloud
	  MYSQL_PASSWORD: nextcloud
	networks:
	  - proxy-tier   
	  
  app:
	image: nextcloud
	links:
	  - db
	ports:
	  - 80:80
	volumes:
	  - ./nextcloud/config:/var/www/html/config
	  - ./nextcloud/apps:/var/www/html/apps
	  - ./nextcloud/data:/var/www/html/data
	restart:
	  always
	networks:
	  - proxy-tier

  redis:
	image: redis
	container_name: redis
	networks:
	  - proxy-tier      
	  
volumes:
  config-volume:
  nextcloud:
  db:
  
networks:
  proxy-tier:
	external:
	  name: nginx-proxy
@polymathuk

This comment has been minimized.

Copy link

@polymathuk polymathuk commented Jun 17, 2019

I have set my instance of this project behind an NGINX reverse proxy. The setup is that I have one internet facing IP and I host quite a few sites (and other things - email etc). I use the nameserver zone editor to carve up subdomains on my main website which allows me to host different services for my own use (I have a search engine, a wiki, a website, a nextcloud server and so on). All of these things are setup on VMs. The internet facing router has a portforward rule to send all port 80 requests to 192.168.1.15 which is the NGINX server. This then inspects the header for the originating domain (or subdomain) and it then upgrades the headers and points each request to a local network IP, which is of course the IP of the correct server for that domain or subdomain. I have also opened port 9980 to also pass all traffic to the NGINX server 192.168.15 - this is important!
My nextcloud instance is IP 192.168.1.18, the Libreoffice is 192.168.1.19
The NGINX entries for this (sites-available/default) are:

server {
        listen 80;
        server_name nclonc.mydomain.co.uk;
        location / {
        proxy_pass http://192.168.1.18:80;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connetion 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
        }
}

server {
        listen 80;
        server_name nclolo.mydomain.co.uk;
        location / {
        proxy_pass http://192.168.1.19:9980;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connetion 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
        }
}

This setup works, but, in this part of the wiki "Then go to Configuration->Collabora Online and enter the domain name of your other VM, e.g. http://libreoffice.yourhost:9980" you must omit the :9980 because the NGINX header upgrade handles this portnumber change.

To get to the nextcloud from anywhere on the web (ie not on the local network) I just go to:
nclonc.mydomain.co.uk
and login as normal. When I want to edit a LO document, I just click on it and all the redirects etc work in the background fine.

Hope this helps someone!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can鈥檛 perform that action at this time.