Skip to content

Instantly share code, notes, and snippets.

@nicolas17
Created November 23, 2017 22:39
Show Gist options
  • Save nicolas17/d3426cbd3ef89fa3be2a9599a69adc95 to your computer and use it in GitHub Desktop.
Save nicolas17/d3426cbd3ef89fa3be2a9599a69adc95 to your computer and use it in GitHub Desktop.
SSL or non-SSL Apache virtualhost
{% 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 %}
{% 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