This commit is contained in:
zeaslity
2024-11-27 16:37:19 +08:00
parent 2127577827
commit 5d20e4422d
3 changed files with 105 additions and 23 deletions

View File

@@ -1,43 +1,50 @@
# Restrict access to the website by IP or wrong domain name) and return 400
server {
listen unix:/dev/shm/h1.sock proxy_protocol default_server;
listen unix:/dev/shm/h2c.sock http2 proxy_protocol default_server;
set_real_ip_from unix:;
real_ip_header proxy_protocol;
# listen unix:/dev/shm/h1.sock proxy_protocol default_server;
# listen unix:/dev/shm/h2c.sock http2 proxy_protocol default_server;
listen 5000;
http2 on;
# set_real_ip_from unix:;
# real_ip_header proxy_protocol;
server_name _;
return 400;
return 400 "not allowed";
}
server {
listen 5001;
server_name _;
return 400 "not allowed";
}
# HTTP1 UDS listener
server {
listen unix:/dev/shm/h1.sock proxy_protocol; # HTTP/1.1 server monitor process and enable PROXY protocol reception
set_real_ip_from unix:;
real_ip_header proxy_protocol;
server_name book.107421.xyz xx.tc.hk.go.107421.xyz; # Change to your own domain name(s)
#listen unix:/dev/shm/h1.sock proxy_protocol;
listen 5001;
server_name xx.tc.hk.go.107421.xyz book.107421.xyz;
location / {
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always; # enable HSTS
root /var/www/html; # Modify to the path of the WEB file stored by yourself (check the permissions)
root /var/www/html/;
index index.html index.htm;
}
}
# HTTP2 UDS listener
server {
listen unix:/dev/shm/h2c.sock http2 proxy_protocol; # H2C server monitor process and enable PROXY protocol reception
set_real_ip_from unix:;
real_ip_header proxy_protocol;
server_name book.107421.xyz xx.tc.hk.go.107421.xyz; # Change to your own domain name(s) (don't forget to add the certificates to xray config)
# listen unix:/dev/shm/h2c.sock http2 proxy_protocol;
listen 5000;
http2 on;
server_name xx.tc.hk.go.107421.xyz book.107421.xyz;
# grpc settings
grpc_read_timeout 1h;
grpc_send_timeout 1h;
grpc_set_header X-Real-IP $remote_addr;
# grpc_read_timeout 1h;
# grpc_send_timeout 1h;
# grpc_set_header X-Real-IP $remote_addr;
# Decoy website
location / {
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always; # enable HSTS
root /var/www/html; # Modify to the path of the WEB file stored by yourself (check the permissions)
root /var/www/html;
index index.html index.htm;
}
}