-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx-proxy.conf
120 lines (97 loc) · 3.07 KB
/
nginx-proxy.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
upstream srvapi {
server backend:8000;
}
upstream srvfrontend {
server frontend:3000;
}
server {
listen 80;
charset utf-8;
# Increase max upload size
client_max_body_size 400M;
gzip on;
gzip_comp_level 9;
gzip_min_length 128;
gzip_types text/plain application/javascript application/x-javascript text/javascript text/xml text/css text/html application/json application/vnd.ms-fontobject application/x-font-ttf font/opentype image/svg+xml image/x-icon;
proxy_send_timeout 180s;
proxy_read_timeout 180s;
fastcgi_send_timeout 180s;
fastcgi_read_timeout 180s;
proxy_connect_timeout 180;
send_timeout 180;
uwsgi_read_timeout 180s;
uwsgi_send_timeout 180s;
# Frontend NextJs/React
# Proxy pass to frontend development server with live relead
# Based in this article: https://nathanfriend.io/2018/05/14/live-reloading-an-angular-2-app-behind-nginx.html
location / {
proxy_pass $scheme://srvfrontend;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
# live reload
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_cache_bypass $http_upgrade;
}
# Backend Django DRF API endpoints
location /api {
proxy_pass $scheme://srvapi;
# include uwsgi_params;
# uwsgi_pass srvapi;
# uwsgi_read_timeout 180s;
# uwsgi_send_timeout 180s;
}
# Backend Django Admin
location /admin {
proxy_pass $scheme://srvapi;
# include uwsgi_params;
# uwsgi_pass srvapi;
}
location /django_static {
proxy_pass $scheme://srvapi;
# include uwsgi_params;
# uwsgi_pass srvapi;
}
location /media {
proxy_pass $scheme://srvapi;
# uwsgi_pass $scheme://srvapi$request_uri;
}
# location /auth {
# include uwsgi_params;
# uwsgi_pass srvapi;
# uwsgi_read_timeout 180s;
# uwsgi_send_timeout 180s;
# }
# # /Data Diretorio que aponta para /archive
# location /data/ {
# alias /var/www/data/;
# try_files $uri $uri/ /index.html;
# autoindex off;
# }
# Mkdocs User Documentation
# location /docs/ {
# proxy_pass http://userdocs/;
# # proxy_set_header X-Forwarded-For $remote_addr;
# # proxy_set_header X-Real-IP $remote_addr;
# # proxy_set_header Host $host;
# # # live reload
# # proxy_http_version 1.1;
# # proxy_set_header Upgrade $http_upgrade;
# # proxy_set_header Connection 'upgrade';
# # proxy_cache_bypass $http_upgrade;
# }
# Celery Flower
location /flower {
proxy_pass http://flower:5555;
}
# Mailhog Web UI
location /mailpit/ {
proxy_pass http://mailpit:8025;
# configure the websocket
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
}
}