Created
November 23, 2017 22:39
-
-
Save nicolas17/d3426cbd3ef89fa3be2a9599a69adc95 to your computer and use it in GitHub Desktop.
SSL or non-SSL Apache virtualhost
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% if use_ssl|default(False) %} | |
<VirtualHost *:80> | |
{{ self.common() }} | |
{{ self.redirect() }} | |
</VirtualHost> | |
<VirtualHost *:443> | |
{{ self.common() }} | |
{{ self.main() }} | |
{{ self.enable_ssl() }} | |
</VirtualHost> | |
{% else %} | |
<VirtualHost *:80> | |
{{ self.common() }} | |
{{ self.main() }} | |
</VirtualHost> | |
{% endif %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends "apache-vhost.j2" %} | |
{% block common %} | |
ServerAdmin [email protected] | |
ServerName status.kde.org | |
DocumentRoot /srv/www/status.kde.org | |
ErrorLog ${APACHE_LOG_DIR}/status.kde.org-error.log | |
CustomLog ${APACHE_LOG_DIR}/status.kde.org.log combined | |
{% endblock %} | |
{% block redirect %} | |
Redirect / https://status.kde.org/ | |
{% endblock %} | |
{% block main %} | |
# Enable proxying to Grafana, which will do the actual serving | |
ProxyRequests Off | |
ProxyPass / http://127.0.0.1:3000/ retry=0 | |
{% endblock %} | |
{% block enable_ssl %} | |
# Enable SSL | |
Include /etc/apache2/common/ssl.conf | |
Include /etc/apache2/common/ssl-kde-org.conf | |
{% endblock %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment