-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnginx.conf
More file actions
109 lines (87 loc) · 2.34 KB
/
nginx.conf
File metadata and controls
109 lines (87 loc) · 2.34 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
user nginx;
worker_processes auto;
pid /run/nginx.pid;
events {
worker_connections 500;
multi_accept on;
use epoll;
}
http {
log_format json_combined escape=json '{ "time_local": "$time_local", '
'"host": "$host", '
'"remote_addr": "$remote_addr", '
'"remote_user": "$remote_user", '
'"request": "$request", '
'"status": "$status", '
'"body_bytes_sent": "$body_bytes_sent", '
'"request_time": "$request_time", '
'"http_referrer": "$http_referer", '
'"http_user_agent": "$http_user_agent" }';
server_tokens off;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
client_max_body_size 100M;
server_names_hash_bucket_size 64;
include /etc/nginx/mime.types;
default_type application/octet-stream;
error_log /dev/stderr info;
gzip on;
server {
charset utf-8;
listen 80;
server_name _;
expires 1h;
root /app/main;
index index.html;
set_real_ip_from 0.0.0.0/0;
access_log /dev/stdout json_combined;
error_log /dev/stderr info;
location = /healthz {
access_log off;
add_header Content-Type text/plain;
return 200;
}
location = /trdl.asc {
return 301 /trdl-client.asc;
}
location /assets {
expires 1h;
rewrite ^/assets(.*)$ /assets$1 break;
}
location / {
try_files $uri $uri/ =404;
}
error_page 404 /404.html;
}
# ru.
server {
charset utf-8;
listen 80;
server_name ~^ru[\.\-].+$;
expires 1h;
root /app/ru;
index index.html;
set_real_ip_from 0.0.0.0/0;
access_log /dev/stdout json_combined;
error_log /dev/stderr info;
location = /healthz {
access_log off;
add_header Content-Type text/plain;
return 200;
}
location = /trdl.asc {
return 301 /trdl-client.asc;
}
location /assets {
expires 1h;
rewrite ^/assets(.*)$ /assets$1 break;
}
location / {
try_files $uri $uri/ =404;
}
error_page 404 /404.html;
}
}