Skip to content

Commit

Permalink
Update ceamdev_backend.conf
Browse files Browse the repository at this point in the history
  • Loading branch information
popenc committed Apr 18, 2024
1 parent c618ea6 commit 713cdbc
Showing 1 changed file with 18 additions and 29 deletions.
47 changes: 18 additions & 29 deletions ceamdev_backend.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ map $http_origin $allowed_origins {
default "";
}

upstream cts_pkasolver_flask {
server cts-pkasolver:8080;
}

upstream cts_molgpka_flask {
server cts-molgpka:8080;
}

# HTTP -> HTTPS Redirect
server {
listen 80;
Expand Down Expand Up @@ -67,35 +75,6 @@ server {
# Removes Nginx version from headers:
server_tokens off;

location /static_qed/ {
alias /src/collected_static/;
}
location /assets/ {
alias /src/collected_static/hms/webapp/assets/;
}
location /hms/assets/ {
alias /src/collected_static/hms/webapp/assets/;
}

location / {
try_files $uri @uwsgi_django;
}

location @uwsgi_django {
include uwsgi_params;
uwsgi_pass uwsgi_django:8080; # 'uwsgi_django' is the hostname given in Docker-Compose YAML 'links' section
uwsgi_connect_timeout 180;
proxy_read_timeout 600;
proxy_send_timeout 600;
uwsgi_read_timeout 600s;
uwsgi_send_timeout 600s;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# HSTS Policy (max-age=60 == 1 min), 31536000 = 1 year Unknown if proxy_set_header disables inheritance like add_header
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
}

# Cyanweb API:
location /cyan/app/api {
include /etc/nginx/uwsgi_params;
Expand Down Expand Up @@ -163,4 +142,14 @@ server {
proxy_pass http://172.17.0.1:5003/envipath/rest/run;
}

location /molgpka {
include /etc/nginx/uwsgi_params;
uwsgi_pass cts_molgpka_flask;
}

location /pkasolver {
include /etc/nginx/uwsgi_params;
uwsgi_pass cts_pkasolver_flask;
}

}

0 comments on commit 713cdbc

Please sign in to comment.