-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf
35 lines (31 loc) · 968 Bytes
/
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
# NGINX handles gzip compression of responses from the app server
gzip on;
gzip_proxied any;
gzip_types text/plain text/css text/javascript application/json;
gzip_min_length 1000;
server {
listen 80;
if ($http_x_forwarded_proto = 'http') {
return 301 https://api.SITE_URL$request_uri;
}
location / {
proxy_pass http://api:8000/;
proxy_http_version 1.1;
}
location /api/ {
proxy_pass http://api:8000/api/;
proxy_http_version 1.1;
# make sure nginx doesn't intercept JSON error responses from API and replace them with HTML
proxy_intercept_errors off;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_cache_bypass $http_upgrade;
}
location /flower/ {
proxy_pass http://celery_flower:5555/;
proxy_http_version 1.1;
}
}