-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf
80 lines (70 loc) · 2.12 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
load_module modules/ngx_http_geoip2_module.so;
daemon off;
user www-data;
worker_processes auto;
pid /run/nginx.pid;
events {
worker_connections 768;
}
http {
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 650;
types_hash_max_size 2048;
include mime.types;
default_type application/octet-stream;
access_log /dev/stdout;
error_log /dev/stderr info;
# gzip on;
# gzip_comp_level 8;
# gzip_min_length 1100;
# gzip_buffers 16 8k;
# gzip_proxied any;
# gzip_types text/plain text/css text/js text/xml text/javascript application/javascript application/x-javascript application/json application/xml application/xml+rss image/svg+xml;
# gzip_vary on;
proxy_read_timeout 76000;
proxy_send_timeout 76000;
geoip2 /GeoLite2-Country.mmdb {
$geoip2_metadata_country_build metadata build_epoch;
$geoip2_data_country_code source=$http_x_forwarded_for country iso_code;
$geoip2_data_country_name source=$http_x_forwarded_for country names en;
}
server
{
listen 8081;
root /var/www/html;
index index.html;
location = /index.html {
# kill cache
add_header Last-Modified $date_gmt;
add_header Cache-Control 'no-store, no-cache';
if_modified_since off;
expires off;
etag off;
}
#
location = /config.js {
# kill cache
add_header Last-Modified $date_gmt;
add_header Cache-Control 'no-store, no-cache';
if_modified_since off;
expires off;
etag off;
}
location /echo {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Geoip-build a:$geoip2_metadata_country_build;
proxy_set_header Geoip-Country-Code a:$geoip2_data_country_code;
proxy_set_header Geoip-Country-Name a:$geoip2_data_country_name;
proxy_set_header Test test;
proxy_pass http://echo:8080;
}
location / {
try_files $uri /index.html;
# add_header Cache-Control 'public';
# expires 48h;
}
}
}