Files
@ ac8884ab98ca
Branch filter:
Location: majic-ansible-roles/roles/wsgi_website/templates/nginx_site.j2 - annotation
ac8884ab98ca
2.4 KiB
text/plain
MAR-218: Fix some minor issues for the test runner script:
- No need to use the $ variable syntax for arithmetic operations.
- Use correct form when printing the list of roles (@ -> *).
- Fix missing quote when assembling the list of roles.
- No need to use the $ variable syntax for arithmetic operations.
- Use correct form when printing the list of roles (@ -> *).
- Fix missing quote when assembling the list of roles.
dfb91e411e40 dfb91e411e40 dfb91e411e40 dfb91e411e40 dfb91e411e40 dfb91e411e40 dfb91e411e40 dfb91e411e40 dfb91e411e40 981584549895 d26fe0368a4b 981584549895 981584549895 981584549895 d26fe0368a4b d26fe0368a4b d26fe0368a4b 18cd76ec050d 18cd76ec050d d26fe0368a4b 3352797ee517 3352797ee517 3352797ee517 3352797ee517 1b05bae8e440 1b05bae8e440 1b05bae8e440 1b05bae8e440 1b05bae8e440 bd13e65e0e94 981584549895 981584549895 981584549895 bd13e65e0e94 bd13e65e0e94 981584549895 bd13e65e0e94 981584549895 981584549895 981584549895 981584549895 981584549895 bd13e65e0e94 bd13e65e0e94 981584549895 981584549895 981584549895 819d02d81946 981584549895 981584549895 981584549895 981584549895 8944b8348567 8944b8348567 67dd87d59abb 67dd87d59abb 981584549895 981584549895 981584549895 4ca98a158269 4ca98a158269 4ca98a158269 4ca98a158269 bf1f75a58072 bf1f75a58072 bf1f75a58072 bf1f75a58072 bf1f75a58072 bf1f75a58072 4ca98a158269 4ca98a158269 981584549895 981584549895 981584549895 | server {
# HTTP (plaintext) configuration.
listen 80;
server_name {{ fqdn }};
# Redirect plaintext connections to HTTPS
return 301 https://$host$request_uri;
}
server {
# Base settings.
root {{ home }}/htdocs/;
server_name {{ fqdn }};
# HTTPS (TLS) configuration.
listen 443 ssl;
listen [::]:443 ssl;
ssl_certificate_key /etc/ssl/private/{{ fqdn }}_https.key;
ssl_certificate /etc/ssl/certs/{{ fqdn }}_https.pem;
# Set-up HSTS header for preventing downgrades for users that visited the
# site via HTTPS at least once.
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
{% for config in additional_nginx_config -%}
# {{ config.comment }}
{{ config.value }}
{% endfor -%}
{% if rewrites -%}
# Site rewrites.
{% for rewrite in rewrites -%}
rewrite {{ rewrite }};
{% endfor -%}
{% endif %}
{% if static_locations -%}
# Static locations
{% for location in static_locations -%}
location {{ location }} {
try_files $uri $uri/ =404;
}
{% endfor -%}
{% endif %}
# Pass remaining requests to the WSGI server.
location / {
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
{% for header, value in http_header_overrides | dictsort -%}
proxy_set_header {{ header }} "{{ value }}";
{% endfor -%}
proxy_pass http://unix:/run/wsgi/{{ fqdn }}.sock;
}
{% if environment_indicator -%}
# Show environment indicator on HTML pages.
sub_filter_types text/html;
sub_filter_once on;
sub_filter "</body>" "
<details open='true' style='position: fixed; left: 0; width: 100%; line-height: 1.5em; font-weight: bold; color: {{ environment_indicator.text_colour }};'>
<summary style='background-color: {{ environment_indicator.background_colour }}; list-style-type: none; position: fixed; bottom: 5px; z-index: 999999;'>🞀🞂</summary>
<div style='background-color: {{ environment_indicator.background_colour }}; width: 100%; text-align: center; position: fixed; bottom: 5px; z-index: 999998;'>{{ environment_indicator.text }}</div>
</details>
";
{% endif -%}
access_log /var/log/nginx/{{ fqdn }}-access.log;
error_log /var/log/nginx/{{ fqdn }}-error.log;
}
|