forked from YakLabs/kube-openresty-ingress
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
73 lines (58 loc) · 1.76 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
worker_processes auto;
daemon off;
error_log stderr warn;
worker_rlimit_nofile 131072;
user nobody nogroup;
events {
worker_connections 16384;
}
http {
include resolvers.conf;
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
access_log /dev/stdout;
keepalive_timeout 75;
keepalive_requests 100;
proxy_read_timeout 30s;
proxy_send_timeout 30s;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
proxy_set_header X-Forwarded-Port $http_x_forwarded_port;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
client_body_temp_path /tmp/client_body 1 1;
proxy_temp_path /tmp/proxy 1 1;
lua_shared_dict ingress 8m;
lua_shared_dict dns_cache 16m;
lua_package_path '.?.lua;./lib/?.lua;;';
server {
listen 8080 default_server;
location /nginx_status {
stub_status on;
}
location /healthz {
echo ok;
}
location /config {
content_by_lua 'require("ingress").config(ngx)';
}
}
init_by_lua 'require("ingress").init(ngx, {})';
init_worker_by_lua 'require("ingress").init_worker(ngx)';
server {
listen 80 default_server;
location / {
set $upstream_host '';
set $upstream_port '';
access_by_lua 'require("ingress").content(ngx)';
proxy_pass http://$upstream_host:$upstream_port$request_uri;
}
}
}