-
Notifications
You must be signed in to change notification settings - Fork 12
/
model-service.conf
28 lines (25 loc) · 1.02 KB
/
model-service.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
server {
listen 80;
listen [::]:80;
server_name model-service.worldmodelers.com;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl;
server_name model-service.worldmodelers.com;
ssl_certificate /etc/letsencrypt/live/model-service.worldmodelers.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/model-service.worldmodelers.com/privkey.pem;
auth_basic "Model Service";
auth_basic_user_file /etc/apache2/.htpasswd;
location / {
proxy_pass http://127.0.0.1:8080;
# CORS
if ($request_method = OPTIONS ) {
add_header 'Access-Control-Allow-Methods' 'GET,OPTIONS,PUT,DELETE' always;
add_header 'Access-Control-Allow-Credentials' 'true' always;
add_header 'Access-Control-Allow-Origin' '$http_origin' always;
add_header 'Access-Control-Allow-Headers' 'Authorization,DNT,User-Agent,Keep-Alive,Content-Type,accept,origin,X-Requested-With' always;
return 200;
}
}
}