crafty-4/config_examples/apache2.conf.example

45 lines
1.3 KiB
Plaintext
Raw Normal View History

2022-03-30 18:56:50 +00:00
#Base config made by Justman10000 and Zedifus (https://gitlab.com/Zedifus)
2022-05-24 01:23:29 +00:00
#Adapted for WSS by pretzelDewey https://gitlab.com/amcmanu3
2022-03-27 21:30:01 +00:00
#For this config you need to add the following mods
#mod_ssl
#mod_rewrite
#mod_http_upgrade
#mod_wss
2022-03-27 21:27:03 +00:00
<VirtualHost _default_:80>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
RewriteEngine on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</VirtualHost>
<VirtualHost _default_:443>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
ProxyPreserveHost On
SSLProxyEngine On
SSLProxyVerify none
SSLProxyCheckPeerCN off
SSLProxyCheckPeerName off
SSLProxyCheckPeerExpire off
#This is important for web sockets which are required by crafty to run!
RewriteEngine on
RewriteCond %{HTTP:Upgrade} websocket [NC]
RewriteCond %{HTTP:Connection} upgrade [NC]
RewriteRule .* "wss://127.0.0.1:8443%{REQUEST_URI}" [P]
SSLCertificateFile /var/opt/minecraft/crafty4/app/config/web/certs/commander.cert.pem
2022-03-27 21:27:03 +00:00
SSLCertificateKeyFile /var/opt/minecraft/crafty4/app/config/web/certs/commander.key.pem
2022-03-27 21:27:03 +00:00
ProxyPass / https://127.0.0.1:8443/
ProxyPassReverse / https://127.0.0.1:8443/
ProxyRequests off
</VirtualHost>