blob: 5813f5dbbeb1227ba917d2887ebfe6b57c70d54f [file] [log] [blame]
{%- from "devops_portal/map.jinja" import control with context -%}
{%- from "devops_portal/map.jinja" import services with context -%}
daemon off;
worker_processes 1;
error_log /dev/stderr;
pid /var/run/nginx/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
sendfile on;
access_log /dev/stdout;
server {
listen 0.0.0.0:{{ control.container.container_port }} default_server;
root /opt/devops-portal/;
gzip on;
gzip_min_length 1000;
gzip_types
text/plain
text/css
application/json
application/javascript
application/x-javascript;
location / {
try_files $uri /index.html;
}
{%- for service_name in services %}
{%- set service = control.services[service_name]|default({}) %}
{%- if service.enabled and service.configure_proxy|default(False) %}
location /api/{{ service_name }} {
proxy_pass {{ service.endpoint }};
}
{%- endif %}
{%- endfor %}
}
}