ServerName {{ domain }} Redirect permanent / https://{{ domain }}/ ServerName {{ domain }} SSLEngine on SSLCertificateFile {{ ssl_cert }} SSLCertificateKeyFile {{ ssl_key }} DocumentRoot {{ install_dir }} Options FollowSymLinks AllowOverride None Require all granted # Proxy BOSH requests to Prosody ProxyPreserveHost on ProxyPass /http-bind http://127.0.0.1:{{ prosody_port }}/http-bind ProxyPassReverse /http-bind http://127.0.0.1:{{ prosody_port }}/http-bind # Proxy WebSocket requests to Prosody RewriteEngine on RewriteCond %{HTTP:Upgrade} websocket [NC] RewriteCond %{HTTP:Connection} upgrade [NC] RewriteRule ^/xmpp-websocket(.*) ws://127.0.0.1:{{ prosody_port }}/xmpp-websocket$1 [P,L] ProxyPass /xmpp-websocket http://127.0.0.1:{{ prosody_port }}/xmpp-websocket ProxyPassReverse /xmpp-websocket http://127.0.0.1:{{ prosody_port }}/xmpp-websocket