-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathnginx.conf
61 lines (45 loc) · 1.64 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
user nginx;
worker_processes auto;
pid /run/nginx.pid;
load_module /usr/lib64/nginx/modules/ngx_stream_module.so;
events {
worker_connections 1048576;
multi_accept on;
use epoll;
}
http {
resolver 169.254.169.253 ipv6=off;
server {
listen 80 proxy_protocol;
location / {
proxy_set_header Host $host;
proxy_pass http://$host:80;
proxy_http_version 1.1;
}
set_real_ip_from 192.168.0.0/16;
real_ip_header proxy_protocol;
}
include /etc/nginx/ipcontrol.conf;
log_format basic '$time_iso8601 $remote_addr $proxy_protocol_addr $proxy_protocol_port $request_uri $server_port '
'$status $upstream_addr $upstream_bytes_sent $upstream_bytes_received $upstream_connect_time';
access_log /var/log/nginx/http_access.log basic;
error_log /var/log/nginx/http_error.log crit;
}
stream {
resolver 169.254.169.253 ipv6=off;
map $bytes_received $notAHealthCheck {
"~0" 0;
default 1;
}
server {
listen 443 proxy_protocol;
proxy_pass $ssl_preread_server_name:$server_port;
ssl_preread on;
set_real_ip_from 192.168.0.0/16;
}
include /etc/nginx/ipcontrol.conf;
log_format basic '$time_iso8601 $remote_addr $proxy_protocol_addr $proxy_protocol_port $protocol $server_port '
'$status $upstream_addr $upstream_bytes_sent $upstream_bytes_received $session_time $upstream_connect_time';
access_log /var/log/nginx/stream_access.log basic if=$notAHealthCheck;
error_log /var/log/nginx/stream_error.log crit;
}