-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathnginxprod.conf
32 lines (26 loc) · 894 Bytes
/
nginxprod.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
limit_req_zone $binary_remote_addr zone=mylimit:10m rate=20r/s;
server {
listen 80;
server_name www.netdis.org;
return 301 http://netdis.org$request_uri;
}
server {
listen 80;
server_name netdis.org;
client_max_body_size 5M;
location / {
root /usr/share/nginx/html;
try_files $uri /index.html;
}
location /api/ {
limit_req zone=mylimit burst=300;
proxy_pass http://backend:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# add_header Access-Control-Allow-Origin *;
# add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS';
# add_header Access-Control-Allow-Headers 'Origin, Content-Type, X-Auth-Token, Authorization';
}
}