NTP_V2/deploy/prod/apache-ntp.conf

33 lines
1.3 KiB
Plaintext

# Apache virtual hosts that publish the production container as https://<production-host>/
# NOT applied by the deployment. Replace <production-host>, the certificate paths and the upstream address (the host and the
# NTP_PORT of the container), then:
# sudo a2enmod proxy proxy_http headers rewrite ssl
# sudo a2ensite ntp-prod && sudo apachectl configtest && sudo systemctl reload apache2
<VirtualHost *:80>
ServerName <production-host>
RewriteEngine On
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R=301,L]
</VirtualHost>
<VirtualHost *:443>
ServerName <production-host>
ErrorLog ${APACHE_LOG_DIR}/ntp_prod_error.log
CustomLog ${APACHE_LOG_DIR}/ntp_prod_access.log combined
SSLEngine on
SSLCertificateFile /etc/apache2/certificate/<production-host>.cer
SSLCertificateKeyFile /etc/apache2/certificate/<production-host>.key
ProxyPreserveHost On
RequestHeader set X-Forwarded-Proto "https"
# browser hardening (the API also sets these; Apache covers its own error pages)
Header always set Strict-Transport-Security "max-age=31536000"
Header always set X-Content-Type-Options "nosniff"
Header always set X-Frame-Options "DENY"
Header always set Referrer-Policy "same-origin"
ProxyTimeout 120
ProxyPass / http://127.0.0.1:8081/
ProxyPassReverse / http://127.0.0.1:8081/
</VirtualHost>