mirror of
https://github.com/CHN-beta/nixos.git
synced 2026-01-12 04:39:23 +08:00
modules.services.nginx/xray: fix iptables rules
This commit is contained in:
@@ -352,10 +352,12 @@ inputs:
|
||||
${iptables} -t mangle -A OUTPUT -j nginx_proxy_mark
|
||||
${iptables} -t mangle -A nginx_proxy_mark -s 127.0.0.1 -p tcp \
|
||||
-m set --match-set nginx_proxy_port src -j MARK --set-mark 2/2
|
||||
${iptables} -t mangle -A nginx_proxy_mark -j RETURN
|
||||
${iptables} -t mangle -N nginx_proxy
|
||||
${iptables} -t mangle -A PREROUTING -j nginx_proxy
|
||||
${iptables} -t mangle -A nginx_proxy -s 127.0.0.1 -p tcp \
|
||||
-m set --match-set nginx_proxy_port src -j MARK --set-mark 2/2
|
||||
${iptables} -t mangle -A nginx_proxy -j RETURN
|
||||
${ip} rule add fwmark 2/2 table 200
|
||||
${ip} route add local 0.0.0.0/0 dev lo table 200
|
||||
''
|
||||
|
||||
@@ -279,6 +279,7 @@ inputs:
|
||||
"-m set --match-set lo_net dst -j RETURN"
|
||||
"-p tcp -j TPROXY --on-port ${autoPort} --tproxy-mark 1/1"
|
||||
"-p udp -j TPROXY --on-port ${autoPort} --tproxy-mark 1/1"
|
||||
"-j RETURN"
|
||||
])
|
||||
++ [
|
||||
"${iptables} -t mangle -N v2ray_mark -w"
|
||||
@@ -298,7 +299,9 @@ inputs:
|
||||
"-m set --match-set xmu_net dst -j MARK --set-mark 1/1"
|
||||
"-m set --match-set proxy_net dst -j MARK --set-mark 1/1"
|
||||
"-m set --match-set lo_net dst -j RETURN"
|
||||
"-j MARK --set-mark 1/1"
|
||||
"-p tcp -j MARK --set-mark 1/1"
|
||||
"-p udp -j MARK --set-mark 1/1"
|
||||
"-j RETURN"
|
||||
]
|
||||
))
|
||||
++ [
|
||||
|
||||
Reference in New Issue
Block a user