/etc/apache2/sites-enabled
Edit: /etc/apache2/sites-available/qr4y.conf (2824B)
Define HOST_NAME www.qr4y.com
Define HOST_KEY www.qr4y.com
Define WWW_DIR /var/www/qr4y.com/www/
Define WS_PORT 17715
Define OSRM_PORT 17715
ServerName ${HOST_NAME}
ServerAdmin webmaster@localhost
DocumentRoot ${WWW_DIR}
ErrorLog ${APACHE_LOG_DIR}/${HOST_NAME}-error.log
CustomLog ${APACHE_LOG_DIR}/${HOST_NAME}-access.log combined
AllowOverride All
RewriteEngine on
RewriteCond %{SERVER_NAME} =${HOST_NAME}
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
ServerAdmin webmaster@localhost
ServerName ${HOST_NAME}
DocumentRoot ${WWW_DIR}
SSLEngine On
SSLProxyEngine On
ProxyRequests Off
ProxyPreserveHost On
ProxyVia full
# Intermediate configuration, tweak to your needs
SSLProtocol all -SSLv2 -SSLv3 -TLSv1 -TLSv1.1
SSLCipherSuite ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1>
SSLHonorCipherOrder off
SSLSessionTickets off
SSLOptions +StrictRequire
# Add vhost name to log entries:
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" vhost_combined
LogFormat "%v %h %l %u %t \"%r\" %>s %b" vhost_common
SSLCertificateFile /etc/letsencrypt/live/${HOST_KEY}/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/${HOST_KEY}/privkey.pem
#
# ProxyPass http://localhost:${OSRM_PORT}
# ProxyPassReverse http://localhost:${OSRM_PORT}
#
# ProxyPass /socket.io/ ws://127.0.0.1:${WS_PORT}/socket.io/
# ProxyPassReverse /socket.io/ ws://127.0.0.1:${WS_PORT}/socket.io/
ProxyPass http://localhost:${WS_PORT}/socket.io/
ProxyPassReverse http://localhost:${WS_PORT}/socket.io/
ProxyPass http://localhost:${WS_PORT}/
ProxyPassReverse http://localhost:${WS_PORT}/
#
# ProxyPass http://localhost:${WS_PORT}/api
# ProxyPassReverse http://localhost:${WS_PORT}/api
#
RewriteEngine on
RewriteCond %{HTTP:Upgrade} =websocket [NC]
RewriteCond %{HTTP:Connection} Upgrade [NC]
RewriteRule /(.*) ws://127.0.0.1:${WS_PORT}/$1 [P,L]
RewriteCond %{HTTP:Upgrade} !=websocket [NC]
RewriteRule /(.*) http://127.0.0.1:${WS_PORT}/$1 [P,L]
ErrorLog ${APACHE_LOG_DIR}/${HOST_NAME}-error.log
CustomLog ${APACHE_LOG_DIR}/${HOST_NAME}-access.log combined
AllowOverride All