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
49load_module modules/ngx_http_proxy_connect_module.so;
events {
worker_connections 1024;
}
http {
# Enable proxy for HTTP CONNECT requests
proxy_connect;
proxy_connect_allow 443 563;
proxy_connect_connect_timeout 10s;
proxy_connect_data_timeout 10s;
proxy_max_temp_file_size 0;
# Enable REWRITE phase support
rewrite_by_lua_block {
ngx.log(ngx.INFO, "Rewrite phase enabled")
}
map $http_upgrade $proxy_connection {
default upgrade;
"" close;
}
upstream a11yproxy-pool {
least_conn;
server a11yproxy:8888;
}
server {
listen 8888;
location / {
proxy_pass http://$host;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Connection $proxy_connection;
proxy_connect_timeout 3600;
# CONNECT method proxy support
proxy_connect;
}
}
}
# Proxy Connect: https://github.com/chobits/ngx_http_proxy_connect_module/tree/master