David Moreau Simard 9bac0a8c47 Import role for deploying ara-web
The ara_web role is intended as a way to deploy and install the
ara-web project in different ways.

The commit also adds integration test jobs for the role.
The integration job names and general layout will be cleaned up
in a future patch.

Change-Id: Ib59c455bb38f107fef3d5aca3dff42b6f7eac8a7
2019-03-08 17:16:39 -05:00

34 lines
948 B
Django/Jinja

{% if ara_web_dev_server %}
upstream ara_web {
# fail_timeout=0 means we always retry an upstream even if it failed
# to return a good HTTP response
server {{ ara_web_dev_server_bind_address }}:{{ ara_web_dev_server_bind_port }} fail_timeout=0;
}
{% endif %}
server {
listen 80;
keepalive_timeout 5;
server_name {{ ara_web_fqdn }};
root {{ ara_web_static_dir }};
access_log /var/log/nginx/{{ ara_web_fqdn }}_access.log;
error_log /var/log/nginx/{{ ara_web_fqdn }}_error.log;
{% if ara_web_dev_server %}
location / {
# checks if the file exists, if not found proxy to app
try_files $uri @proxy_to_app;
}
location @proxy_to_app {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://ara_web;
}
{% endif %}
}