-
Notifications
You must be signed in to change notification settings - Fork 1
/
nginx.conf
56 lines (44 loc) · 1.27 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
events {
worker_connections 768;
}
http {
map $host $subdomain {
~^(?<sub>.+)\.[^\.]+\.[^\.]+$ $sub;
}
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
ssl_certificate /etc/cert/cert.cer;
ssl_certificate_key /etc/cert/cert.key;
resolver 127.0.0.11 valid=30s;
location /api {
set $upstream_restapi restapi;
access_log off;
proxy_pass http://$upstream_restapi:80;
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 /pgadmin {
set $upstream_restapi pgadmin;
access_log off;
proxy_pass http://$upstream_pgadmin:80;
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 / {
set $upstream_webapp webapp;
access_log off;
proxy_pass http://$upstream_webapp:80;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
}