Created
April 2, 2024 16:47
-
-
Save Ali-Razmjoo/86ee24be0a9fe7be5cabf3e87a8dc0eb to your computer and use it in GitHub Desktop.
Secologist V2Ray HAProxy & Nginx Configuration Examples: https://www.secologist.com/anonymous-v2ray-vpn
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global | |
log stdout format raw local0 | |
maxconn 10000 | |
tune.bufsize 32768 | |
tune.maxrewrite 1024 | |
tune.ssl.default-dh-param 2048 | |
defaults | |
log global | |
mode http | |
option httplog | |
option dontlognull | |
timeout connect 5000ms | |
timeout client 50000ms | |
timeout server 50000ms | |
timeout http-keep-alive 30000ms | |
timeout client-fin 30000ms | |
timeout server-fin 30000ms | |
frontend http_front | |
bind *:8080 | |
mode http | |
timeout client 50s | |
http-request set-var(txn.host) urlp(host) | |
acl host_valid var(txn.host) -m found | |
use_backend dynamic_back if host_valid | |
default_backend default_back | |
backend dynamic_back | |
mode http | |
timeout connect 10s | |
timeout server 50s | |
http-request set-header Host %[var(txn.host)] | |
server dynamic 104.26.1.78:80 | |
backend default_back | |
mode http | |
timeout connect 10s | |
timeout server 50s | |
http-request set-header Host falkenstein-lb-1.vs.secologist.com | |
server default falkenstein-lb-1.vs.secologist.com:80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
worker_processes auto; | |
daemon off; | |
events { | |
worker_connections 4096; | |
multi_accept on; | |
use epoll; | |
} | |
http { | |
resolver 127.0.0.11 valid=30s; | |
server { | |
listen 8080; | |
location / { | |
proxy_pass http://$arg_host:80; | |
proxy_set_header Host $arg_host; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection "upgrade"; | |
proxy_http_version 1.1; | |
# WebSocket support | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
} | |
# Default backend if host is not specified in the URI | |
location = /vip { | |
proxy_pass http://falkenstein-lb-1.vs.secologist.com:80; | |
proxy_set_header Host falkenstein-lb-1.vs.secologist.com; | |
proxy_http_version 1.1; | |
# WebSocket support | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection "upgrade"; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
} | |
} | |
access_log off; | |
error_log /dev/stdout crit; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment