hns_doh_loadbalancer/nginx.conf

78 lines
1.8 KiB
Nginx Configuration File
Raw Normal View History

2023-12-15 15:20:15 +11:00
server {
listen 8001 default_server;
2023-12-15 15:26:08 +11:00
server_name _;
access_log off;
2023-12-15 15:20:15 +11:00
location / {
proxy_ssl_server_name on;
2023-12-15 15:20:15 +11:00
proxy_set_header Host doh.hnshosting.au;
proxy_pass https://doh.hnshosting.au;
2023-12-15 17:13:32 +11:00
add_header X-DoH-Server "Nathan.Woodburn/";
2023-12-15 15:20:15 +11:00
}
2023-12-15 14:29:49 +11:00
}
server {
2023-12-15 15:20:15 +11:00
listen 8002 default_server;
2023-12-15 15:26:08 +11:00
server_name _;
access_log off;
2023-12-15 15:20:15 +11:00
location / {
proxy_ssl_server_name on;
2023-12-15 15:20:15 +11:00
proxy_set_header Host easyhandshake.com;
proxy_pass https://easyhandshake.com:8053;
add_header X-DoH-Server "EasyHandshake.com";
2023-12-15 15:20:15 +11:00
}
}
2023-12-15 15:14:07 +11:00
2023-12-15 15:20:15 +11:00
server {
listen 8003 default_server;
2023-12-15 15:26:08 +11:00
server_name _;
access_log off;
2023-12-15 15:20:15 +11:00
location / {
proxy_ssl_server_name on;
2023-12-15 15:20:15 +11:00
proxy_set_header Host doh.hnsdns.com;
proxy_pass https://doh.hnsdns.com;
add_header X-DoH-Server "HNSDNS.com";
}
}
server {
listen 8004 default_server;
server_name _;
access_log off;
location / {
proxy_ssl_server_name on;
proxy_set_header Host hnsns.net;
proxy_pass https://hnsns.net;
add_header X-DoH-Server "HNSNS.net";
2023-12-15 15:20:15 +11:00
}
}
2023-12-15 15:16:42 +11:00
# Load balancing each node will be timed out for 10 minutes if it fails
2023-12-15 15:20:15 +11:00
upstream main {
server 127.0.0.1:8001 max_fails=1 fail_timeout=10m;
# Disabled for now because it doesn't support HIP5
# server 127.0.0.1:8002 max_fails=1 fail_timeout=10m;
server 127.0.0.1:8003 max_fails=1 fail_timeout=10m;
server 127.0.0.1:8004 max_fails=1 fail_timeout=10m;
2023-12-15 15:20:15 +11:00
}
2023-12-15 15:15:24 +11:00
2023-12-15 15:20:15 +11:00
server {
listen 80;
server_name _;
access_log off;
2023-12-15 17:00:01 +11:00
# For /dns-query requests, we will use the upstream defined above
location /dns-query {
2023-12-15 15:26:08 +11:00
proxy_pass http://main;
2023-12-15 15:20:15 +11:00
}
2023-12-15 17:00:01 +11:00
# All other requests will be redirected to a static page
location / {
root /var/www/html;
index index.html;
2023-12-16 12:26:12 +11:00
# 404 error page
error_page 404 /index.html;
2023-12-15 17:00:01 +11:00
}
2023-12-15 14:29:49 +11:00
}