Commit 085c2abf authored by okhin's avatar okhin 🚴

Adding a uwsgi template for geerlingguy.apache role

parent b6e5b3b1
Pipeline #2463 passed with stages
in 48 seconds
{{ apache_global_vhost_settings }}
{# Set up VirtualHosts #}
{% for vhost in apache_vhosts %}
<VirtualHost {{ apache_listen_ip }}:{{ apache_listen_port }}>
ServerName {{ vhost.servername }}
{% if vhost.serveralias is defined %}
ServerAlias {{ vhost.serveralias }}
{% endif %}
{% if vhost.documentroot is defined %}
DocumentRoot "{{ vhost.documentroot }}"
{% endif %}
{% if vhost.statics is defined %}
{% for static in vhost.statics %}
Alias {{ static.alias }} {{ static.path }}
Proxypass {{ static.alias}} !
{% endfor %}
{% endif %}
{% if vhost.serveradmin is defined %}
ServerAdmin {{ vhost.serveradmin }}
{% endif %}
{% if vhost.uwsgi is defined %}
{% if vhost.uwsgi.socket.startswith("/") %}
Proxypass "/" "unix:{{ vhost.uwsgi.socket }}|uwsgi://{{ vhost.servername }}/"
{% else %}
Proxypass "/" "uwsgi://{{ vhost.uwsgi.socket }}"
{% endif %}
<Location "/">
Require all granted
</Location>
{% endif %}
</VirtualHost>
{% endfor %}
{# Set up SSL VirtualHosts #}
{% for vhost in apache_vhosts_ssl %}
{% if apache_ignore_missing_ssl_certificate or apache_ssl_certificates.results[loop.index0].stat.exists %}
<VirtualHost {{ apache_listen_ip }}:{{ apache_listen_port_ssl }}>
ServerName {{ vhost.servername }}
{% if vhost.serveralias is defined %}
ServerAlias {{ vhost.serveralias }}
{% endif %}
{% if vhost.documentroot is defined %}
DocumentRoot "{{ vhost.documentroot }}"
{% endif %}
SSLEngine on
SSLCipherSuite {{ apache_ssl_cipher_suite }}
SSLProtocol {{ apache_ssl_protocol }}
SSLHonorCipherOrder On
{% if apache_vhosts_version == "2.4" %}
SSLCompression off
{% endif %}
SSLCertificateFile {{ vhost.certificate_file }}
SSLCertificateKeyFile {{ vhost.certificate_key_file }}
{% if vhost.certificate_chain_file is defined %}
SSLCertificateChainFile {{ vhost.certificate_chain_file }}
{% endif %}
{% if vhost.statics is defined %}
{% for static in vhost.statics %}
Alias {{ static.alias }} {{ static.path }}
Proxypass {{ static.alias}} !
{% endfor %}
{% endif %}
{% if vhost.serveradmin is defined %}
ServerAdmin {{ vhost.serveradmin }}
{% endif %}
{% if vhost.uwsgi is defined %}
{% if vhost.uwsgi.socket.startswith("/") %}
Proxypass "/" "unix:{{ vhost.uwsgi.socket }}|uwsgi://{{ vhost.servername }}/"
{% else %}
Proxypass "/" "uwsgi://{{ vhost.uwsgi.socket }}"
{% endif %}
<Location "/">
Require all granted
</Location>
{% endif %}
</VirtualHost>
{% endif %}
{% endfor %}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment