Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Apache reverse proxy configuration for OnlyOffice + Humhub
# MDomain in humhub site config to make it one certificate.
# TODO on next patchday: remove http config
<VirtualHost *:80>
ServerName oo.example.com
DocumentRoot /var/www/oo.example.com/html
ErrorLog /var/www/oo.example.com/log/error.log
CustomLog /var/www/oo.example.com/log/requests.log combined
</VirtualHost>
# Based on https://github.com/ONLYOFFICE/document-server-proxy/blob/master/apache/proxy-https-to-http.conf
# We already have those:
#Listen 80
#Listen 443
# You will need these modules but loading them here causes warnings as they are already loaded.
#LoadModule authn_core_module modules/mod_authn_core.so
#LoadModule authz_core_module modules/mod_authz_core.so
#LoadModule unixd_module modules/mod_unixd.so
#LoadModule proxy_module modules/mod_proxy.so
#LoadModule proxy_http_module modules/mod_proxy_http.so
#LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so
#LoadModule headers_module modules/mod_headers.so
#LoadModule setenvif_module modules/mod_setenvif.so
#LoadModule ssl_module modules/mod_ssl.so
#<IfModule unixd_module>
# User daemon
# Group daemon
#</IfModule>
<VirtualHost *:443>
ServerName oo.example.com
SSLEngine on
SetEnvIf Host "^(.*)$" THE_HOST=$1
RequestHeader setifempty X-Forwarded-Proto https
RequestHeader setifempty X-Forwarded-Host %{THE_HOST}e
ProxyAddHeaders Off
ProxyPassMatch (.*)(\/websocket)$ "ws://example.com:8080/$1$2"
ProxyPass "/" "http://example.com:8080/"
ProxyPassReverse "/" "http://example.com:8080/"
DocumentRoot /var/www/oo.example.com/html
ErrorLog /var/www/oo.example.com/log/error.log
CustomLog /var/www/oo.example.com/log/requests.log combined
</VirtualHost>
#<MDomain oo.example.com>
# MDRequireHttps temporary
#</MDomain>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment