-
Notifications
You must be signed in to change notification settings - Fork 4
/
nginx.conf
152 lines (116 loc) · 4.19 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
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
events {
worker_connections 1024;
}
http {
client_max_body_size 500M;
upstream elasticsearch {
server 127.0.0.1:9200;
keepalive 15;
}
upstream kibana {
server 127.0.0.1:5601;
keepalive 15;
}
upstream fulfill {
server 127.0.0.1:8000;
keepalive 15;
}
upstream debug {
server 127.0.0.1:1234;
keepalive 15;
}
#ssl on;
auth_basic "Elasticsearch auth";
auth_basic_user_file "/etc/nginx/elasticsearch.passwd";
ssl_certificate /etc/letsencrypt/live/utext.club/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/utext.club/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
server {
listen 443 ssl;
server_name utext.club www.utext.club es.utext.club;
location / {
proxy_pass http://elasticsearch;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
ssl_certificate /etc/letsencrypt/live/utext.club/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/utext.club/privkey.pem; # managed by Certbot
}
server {
listen 443 ssl;
server_name kb.utext.club;
location / {
proxy_pass http://kibana;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
ssl_certificate /etc/letsencrypt/live/utext.club/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/utext.club/privkey.pem; # managed by Certbot
}
server {
listen 443 ssl;
server_name fulfill.utext.club;
location / {
proxy_pass http://fulfill;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
ssl_certificate /etc/letsencrypt/live/utext.club/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/utext.club/privkey.pem; # managed by Certbot
}
server {
listen 443 ssl;
server_name debug.utext.club;
location / {
proxy_pass http://debug;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
ssl_certificate /etc/letsencrypt/live/utext.club/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/utext.club/privkey.pem; # managed by Certbot
}
server {
if ($host = debug.utext.club) {
return 301 https://$host$request_uri;
} # managed by Certbot
if ($host = fulfill.utext.club) {
return 301 https://$host$request_uri;
} # managed by Certbot
if ($host = kb.utext.club) {
return 301 https://$host$request_uri;
} # managed by Certbot
if ($host = es.utext.club) {
return 301 https://$host$request_uri;
} # managed by Certbot
if ($host = utext.club) {
return 301 http://$host$request_uri;
}
if ($host = www.utext.club) {
return 301 https://$host$request_uri;
}
if ($host = demo.utext.club) {
return 301 https://bot.dialogflow.com/utext;
}
listen 80 ;
server_name www.utext.club utext.club kb.utext.club es.utext.club debug.utext.club fulfill.utext.club demo.utext.club;
return 404; # managed by Certbot
#listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/utext.club/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/utext.club/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
}