Skip to content

Instantly share code, notes, and snippets.

@dreua
Created December 22, 2020 14:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dreua/400faa0be8b0c15484e863b17e62873e to your computer and use it in GitHub Desktop.
Save dreua/400faa0be8b0c15484e863b17e62873e to your computer and use it in GitHub Desktop.
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