Makefile.am | 10 ++++++++++ etc/apache2/loolwsd.conf | 31 +++++++++++++++++++++++++++++++ etc/nginx/loolwsd.conf | 35 +++++++++++++++++++++++++++++++++++ loolwsd.spec.in | 13 +++++++++++++ 4 files changed, 89 insertions(+)
New commits: commit 9e9ebceb62c6a07c841e529bca98a37fe5462d71 Author: Andras Timar <[email protected]> AuthorDate: Thu Sep 20 10:18:57 2018 +0200 Commit: Michael Meeks <[email protected]> CommitDate: Thu Nov 8 22:05:33 2018 +0100 nginx and apache2 reverse proxy sample config snippets Change-Id: I0bb5a1b1e9ef8a72c2c100c6cbf9acb7e62e591a Reviewed-on: https://gerrit.libreoffice.org/62973 Reviewed-by: Michael Meeks <[email protected]> Tested-by: Michael Meeks <[email protected]> diff --git a/Makefile.am b/Makefile.am index 42e3839cb..291fd07b0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -29,6 +29,14 @@ loolwsdconfigdir = @LOOLWSD_CONFIGDIR@ loolwsdconfig_DATA = loolwsd.xml \ loolkitconfig.xcu +apache2configdir = ${sysconfdir}/apache2/conf-available + +apache2config_DATA = etc/apache2/loolwsd.conf + +nginxconfigdir = ${sysconfdir}/nginx/snippets + +nginxconfig_DATA = etc/nginx/loolwsd.conf + ACLOCAL_AMFLAGS = -I m4 # quick and easy for now. @@ -234,6 +242,8 @@ EXTRA_DIST = discovery.xml \ etc/key.pem \ etc/cert.pem \ etc/ca-chain.cert.pem \ + etc/apache2/loolwsd.conf \ + etc/nginx/loolwsd.conf \ scripts/unocommands.py \ $(man_MANS) diff --git a/etc/apache2/loolwsd.conf b/etc/apache2/loolwsd.conf new file mode 100644 index 000000000..10b66b47f --- /dev/null +++ b/etc/apache2/loolwsd.conf @@ -0,0 +1,31 @@ +# Apache2 reverse proxy configuration for Collabora Online / LibreOffice Online +# Internet <-- SSL --> Reverse Proxy <-- No SSL --> loolwsd +# Make sure that you enable the following Apache2 modules: proxy, proxy_wstunnel, and proxy_http. +# Create a virtual host for Collabora Online / LibreOffice Online and include this configuration file. + + Options -Indexes + + # Encoded slashes need to be allowed + AllowEncodedSlashes NoDecode + + # keep the host + ProxyPreserveHost On + + # static html, js, images, etc. served from loolwsd + # loleaflet is the client part of LibreOffice Online + ProxyPass /loleaflet http://127.0.0.1:9980/loleaflet retry=0 + ProxyPassReverse /loleaflet http://127.0.0.1:9980/loleaflet + + # WOPI discovery URL + ProxyPass /hosting/discovery http://127.0.0.1:9980/hosting/discovery retry=0 + ProxyPassReverse /hosting/discovery http://127.0.0.1:9980/hosting/discovery + + # Main websocket + ProxyPassMatch "/lool/(.*)/ws$" ws://127.0.0.1:9980/lool/$1/ws nocanon + + # Admin Console websocket + ProxyPass /lool/adminws ws://127.0.0.1:9980/lool/adminws + + # Download as, Fullscreen presentation and Image upload operations + ProxyPass /lool http://127.0.0.1:9980/lool + ProxyPassReverse /lool http://127.0.0.1:9980/lool diff --git a/etc/nginx/loolwsd.conf b/etc/nginx/loolwsd.conf new file mode 100644 index 000000000..f55f8829b --- /dev/null +++ b/etc/nginx/loolwsd.conf @@ -0,0 +1,35 @@ + # static files + location ^~ /loleaflet { + proxy_pass http://localhost:9980; + proxy_set_header Host $http_host; + } + + # WOPI discovery URL + location ^~ /hosting/discovery { + proxy_pass http://localhost:9980; + proxy_set_header Host $http_host; + } + + # main websocket + location ~ ^/lool/(.*)/ws$ { + proxy_pass http://localhost:9980; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + proxy_set_header Host $http_host; + proxy_read_timeout 36000s; + } + + # download, presentation and image upload + location ~ ^/lool { + proxy_pass http://localhost:9980; + proxy_set_header Host $http_host; + } + + # Admin Console websocket + location ^~ /lool/adminws { + proxy_pass http://localhost:9980; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + proxy_set_header Host $http_host; + proxy_read_timeout 36000s; + } diff --git a/loolwsd.spec.in b/loolwsd.spec.in index 531857bf4..78e56c1ca 100644 --- a/loolwsd.spec.in +++ b/loolwsd.spec.in @@ -126,6 +126,11 @@ install -D -m 644 sysconfig.loolwsd %{buildroot}/etc/sysconfig/loolwsd install -D -m 444 loolwsd.service %{buildroot}%{_unitdir}/loolwsd.service install -D -m 644 sysconfig.loolwsd %{buildroot}/var/adm/fillup-templates %endif +%if 0%{?rhel} > 0 +install -d -m 755 %{buildroot}/etc/httpd/conf +install -D -m 755 etc/apache2/loolwsd.conf %{buildroot}/etc/httpd/conf +rm %{buildroot}/etc/apache2/conf-available/loolwsd.conf +%endif mkdir -p %{buildroot}/etc/cron.d echo "#Remove old tiles once every 10 days at midnight" > %{buildroot}/etc/cron.d/loolwsd.cron echo "0 0 */1 * * root find /var/cache/loolwsd -type f -a -atime +10 -exec rm {} \;" >> %{buildroot}/etc/cron.d/loolwsd.cron @@ -168,6 +173,14 @@ echo "account required pam_unix.so" >> %{buildroot}/etc/pam.d/loolwsd %config(noreplace) /etc/pam.d/loolwsd %config(noreplace) %attr(640, lool, root) /etc/loolwsd/loolwsd.xml %config /etc/loolwsd/loolkitconfig.xcu +%config(noreplace) /etc/nginx/snippets/loolwsd.conf +%if 0%{?suse_version} > 0 +%config(noreplace) /etc/apache2/conf-available/loolwsd.conf +%endif +%if 0%{?rhel} > 0 +%config(noreplace) /etc/httpd/conf/loolwsd.conf +%endif + %doc README _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
