-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
38 lines (38 loc) · 1.23 KB
/
nginx.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
events {
worker_connections 1024;
multi_accept on;
}
http {
types {
text/html html htm shtml;
text/css css;
text/xml xml;
application/javascript js ts;
}
server {
listen 80;
server_name default_server;
root /usr/share/nginx/html;
# location /api/docs/ {
# rewrite ^/api/docs/(.*) /$1 break;
# proxy_pass http://http_docs:8080/;
# proxy_set_header Host $host;
# proxy_set_header X-Real-IP $remote_addr;
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# }
location / {
try_files $uri $uri/ /index.html;
}
location /api/ {
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, PUT' always;
add_header 'Access-Control-Allow-Headers' 'Authorization, X-Requested-With, Content-Type' always;
add_header 'Access-Control-Allow-Credentials' 'true' always;
if ($request_method = OPTIONS) {
return 200;
}
rewrite ^/api/(.*) /$1 break;
proxy_pass http://orchestrator:8080/;
}
}
}