/
ceamdev_backend.conf
155 lines (120 loc) · 4.47 KB
/
ceamdev_backend.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
map $http_origin $allowed_origins {
"~^https://mywaterway\.epa\.gov$" "https://mywaterway.epa.gov";
"~^https://mywaterway-dev\.app\.cloud\.gov$" "https://mywaterway-dev.app.cloud.gov";
"~^https://mywaterway-stage\.app\.cloud\.gov$" "https://mywaterway-stage.app.cloud.gov";
"~^https://mywaterway-attains\.app\.cloud\.gov$" "https://mywaterway-attains.app.cloud.gov";
"~^https://ceamdev\.ceeopdev\.net$" "https://ceamdev.ceeopdev.net";
# "~^http://localhost:4200$" "http://localhost:4200";
default "";
}
upstream cts_pkasolver_flask {
server cts-pkasolver:8080;
}
upstream cts_molgpka_flask {
server cts-molgpka:8080;
}
# HTTP -> HTTPS Redirect
server {
listen 80;
server_name ceamdev.net;
# Removes Nginx version from headers:
server_tokens off;
return 301 https://$host$request_uri;
}
# qed.epa.gov django front-end HTTPS/SSL
server {
listen 443 ssl default_server;
server_name ceamdev.net;
client_max_body_size 20M;
client_body_buffer_size 20M;
# Allow CORS requests for development purposes, not to be copied to Staging or Production instances.
# add_header Access-Control-Allow-Origin '*';
add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS, DELETE';
# HSTS Policy (max-age=60 == 1 min. 31536000 = 1 year)
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header X-XSS-Protection "1; mode=block";
add_header X-Frame-Options "SAMEORIGIN";
add_header X-Content-Type-Options nosniff;
# add_header Content-Security-Policy "default-src 'self'; font-src *;img-src * data:; script-src *; style-src *";
add_header Access-Control-Expose-Headers "Content-Disposition";
# add_header 'Access-Control-Allow-Origin' "$allowed_origins";
add_header 'Access-Control-Allow-Origin' "*";
add_header Access-Control-Allow-Headers "Authorization,Content-Type,App-Name";
# Self-signed cert and key (container locations):
ssl_certificate /etc/letsencrypt/live/ceeopdev.net/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/ceeopdev.net/privkey.pem;
ssl_session_timeout 5m;
#disable ssl2 and ssl3 per
#https://raymii.org/s/tutorials/Strong_SSL_Security_On_nginx.html
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
# Diffie-Hellman file:
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
# Removes Nginx version from headers:
server_tokens off;
# Cyanweb API:
location /cyan/app/api {
include /etc/nginx/uwsgi_params;
uwsgi_pass uwsgi_flask:5001;
}
# Cyano Admintool
location /admintool {
proxy_pass http://172.17.0.1:8000;
}
# Cyano Admintool Static
location /static {
proxy_pass http://172.17.0.1:8000/static;
}
# Cyano Admintool Media
location /media {
proxy_pass http://172.17.0.1:8000/media;
}
# Cyano API
location /cyan/cyano {
proxy_pass http://172.17.0.1:8080/cyan/cyano;
}
# Cyan-waterbody API (uwsgi)
location /waterbody {
try_files $uri @wb_flask;
}
location @wb_flask {
include uwsgi_params;
uwsgi_pass 172.17.0.1:8085;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# add_header Access-Control-Expose-Headers "Content-Disposition";
}
# Cyano API (qedlinuxapi, new backend)
location /qedlinuxapi/cyan/cyano {
proxy_pass https://qedlinuxapi.epa.gov/cyan/cyano;
}
# Cyan-waterbody API (qedlinuxapi, new backend)
location /qedlinuxapi/waterbody {
proxy_pass https://qedlinuxapi.epa.gov/waterbody;
}
# EPI Suite Proxy to GDIT Windows Dev box
location /epi {
proxy_pass http://172.31.29.163/episuite/rest/episuite; # /estimated and /measured
}
location /biotransformer {
proxy_pass http://172.17.0.1:5002/bt/rest/run;
}
# OPEARWS on GDIT Windows Dev box
location /operaws/opera/rest/run {
proxy_pass http://172.31.29.163:8080/opera/rest/run;
}
location /envipath {
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;
}
}