31 lines
1 KiB
Django/Jinja
31 lines
1 KiB
Django/Jinja
<VirtualHost *:80>
|
|
ServerName {{ domain }}
|
|
Redirect permanent / https://{{ domain }}/
|
|
</VirtualHost>
|
|
|
|
<VirtualHost *:443>
|
|
ServerName {{ domain }}
|
|
SSLEngine on
|
|
SSLCertificateFile {{ ssl_cert }}
|
|
SSLCertificateKeyFile {{ ssl_key }}
|
|
|
|
DocumentRoot {{ install_dir }}
|
|
<Directory {{ install_dir }}>
|
|
Options FollowSymLinks
|
|
AllowOverride None
|
|
Require all granted
|
|
</Directory>
|
|
|
|
# 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
|
|
</VirtualHost>
|