Skip to content

Commit 60516b0

Browse files
committed
feat(nginx): add nginx config
1 parent 8dccc52 commit 60516b0

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

nginx/nginx.conf

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
upstream api {
2+
server api:8000;
3+
}
4+
5+
server {
6+
listen 80;
7+
8+
location / {
9+
return 301 /api/docs;
10+
}
11+
12+
location /api/ {
13+
add_header Access-Control-Allow-Origin "*";
14+
add_header Access-Control-Allow-Methods "GET, POST, PUT, DELETE, OPTIONS, HEAD";
15+
add_header Access-Control-Allow-Headers "content-type";
16+
17+
proxy_set_header Cache-Control 'no-cache';
18+
proxy_set_header Content-Type $http_content_type;
19+
proxy_set_header X-Accel-Buffering 'no';
20+
21+
proxy_http_version 1.1;
22+
proxy_set_header Connection "";
23+
proxy_set_header Upgrade $http_upgrade;
24+
proxy_set_header Host $host;
25+
26+
proxy_buffering off;
27+
proxy_redirect off;
28+
proxy_pass http://api/;
29+
}
30+
31+
location /api/docs {
32+
proxy_redirect off;
33+
proxy_pass http://api/docs;
34+
}
35+
}

0 commit comments

Comments
 (0)