Skip to content

Commit

Permalink
dreambi: Use include instead of overwriting generic conf
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmckinney committed Sep 26, 2024
1 parent d6d971f commit 49413f5
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 246 deletions.
5 changes: 3 additions & 2 deletions pillar/dreambi.sls
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ nginx:
public_access: True
sites:
bi.dream.gov.ua:
configuration: dream-bi
include: dream-bi
servername: bi.dream.gov.ua
context:
proxypass: 159.69.67.60
app: bbd2ec1f-dbb4-4606-9e17-4fb23d87f4e9
proxypass: 159.69.67.60
user: dreambi
244 changes: 0 additions & 244 deletions salt/nginx/files/sites/dream-bi.conf

This file was deleted.

56 changes: 56 additions & 0 deletions salt/nginx/files/sites/dream-bi.conf.include
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
client_max_body_size 20M;

root /home/{{ user }}/public_html/dream;

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /home/{{ user }}/public_html/dream;
}

{%-
for location, path in (
('auth', 'auth'),
('extensions', 'prod/extensions'),
('prod/api', 'prod/api'),
('prod/app', 'prod/app'),
('prod/extensions', 'prod/extensions'),
('prod/hub', 'prod/hub'),
('prod/printing', 'prod/printing'),
('prod/qrs', 'prod/qrs'),
('prod/resources', 'prod/resources'),
('prod/sense/app/' + app + '/', 'prod/sense/app/' + app + '/'),
('prod/tempcontent', 'prod/tempcontent'),
)
%}

location /{{ location }} {
proxy_pass https://{{ proxypass }}:444/{{ path }};
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_max_temp_file_size 0;
proxy_connect_timeout 15;
proxy_read_timeout 1h;
proxy_http_version 1.1;
}
{%- endfor %}

location /monitor {
server_name_in_redirect on;
return 302 /auth/sense/app/{{ app }}/overview;
}

location /afghanistan {
try_files $uri $uri/ /afghanistan/index.html;
}

location /mdcp {
root /home/{{ user }}/public_html;
index index.html;
}

location /index.html {
add_header Cache-Control no-cache;
}

0 comments on commit 49413f5

Please sign in to comment.