-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnginx.conf
61 lines (50 loc) · 1.52 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
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name _; #catch-all
resolver 8.8.8.8;
proxy_ssl_server_name on;
# ignore http traffic - just pass it through
location / {
proxy_set_header Host $host;
proxy_pass $scheme://$host:$server_port;
}
# redirect WebSocket url to some local WebSocket MITM server
location /ws {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:444;
proxy_http_version 1.1;
}
}
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name _; #catch-all
resolver 8.8.8.8;
proxy_ssl_server_name on;
ssl_certificate cert.crt;
ssl_certificate_key cert.key;
# ignore https traffic - just pass it through
location / {
proxy_set_header Host $host;
proxy_pass $scheme://$host:$server_port;
}
# redirect WebSocket url to some local WebSocket MITM server
location /ws {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_pass https://127.0.0.1:444;
proxy_http_version 1.1;
}
}
}