forked from frontend-park-mail-ru/2021_2_MonKeys
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnginx.conf
More file actions
171 lines (141 loc) · 4.43 KB
/
nginx.conf
File metadata and controls
171 lines (141 loc) · 4.43 KB
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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
# r
# ain
# rai
# nrain
# rainrai
# nrainrain
# ainrainrain
# rainrainrainr
# ainrainrainrain
# rainrainrainrainr
# ainrainrainrainrainra
# inra nrainrainrainrainrai
# nrain inrainrainrainrainrain
# rain nrainrainrainrainrainrai
# nrai inrainrainrainrainrainrain
# rai inrainrainrainrainrainrainr
# rain nrainrainrainrainrainrainr
# rainr nrainrainrainrainrainrai
# nrain ainrainrainrainrainrain
# rainrainrainrainrainrainr
# rainranirainrainrainr
# ainrainrain
include /etc/nginx/main.d/*.conf;
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
# multi_accept on;
}
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
##
# SSL Settings
##
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # Dropping SSLv3, ref: POODLE
ssl_prefer_server_ciphers on;
##
# Logging Settings
##
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
##
# Gzip Settings
##
include /etc/nginx/conf.d/*.conf;
include /usr/share/nginx/modules/*.conf;
upstream go_server {
server localhost:8000;
}
upstream chat_server {
server localhost:8001;
}
upstream auth_server {
server localhost:8002;
}
server {
listen 80;
server_name drip.monkeys.team;
access_log /var/log/nginx/Drip.access.log;
error_log /var/log/nginx/Drip.error.log;
client_max_body_size 20M;
location /api/v1/apiws {
proxy_pass http://chat_server;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1;
proxy_read_timeout 2h;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location /api/v1/notifications {
proxy_pass http://go_server;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1;
proxy_read_timeout 6h;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location /api/v1/chats {
proxy_pass http://chat_server;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /api/v1/chat {
proxy_pass http://chat_server;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /api/v1/auth {
proxy_pass http://auth_server;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /api/v1/ {
proxy_pass http://go_server;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /media/ {
proxy_pass http://go_server;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
add_header Cache-Control max-age=31536000;
}
location / {
root /usr/share/nginx/html/;
add_header Service-Worker-Allowed /;
index index.html;
add_header Cache-Control max-age=0;
autoindex on;
autoindex_exact_size on;
set $fallback_file /index.html;
if ($http_accept !~ text/html) {
set $fallback_file /null;
}
if ($uri ~ /$) {
set $fallback_file /null;
}
try_files $uri $fallback_file;
}
location /status {
access_log off;
default_type text/plain;
add_header Content-Type text/plain;
return 200 "alive";
}
sendfile on;
}
}