show real ip
This commit is contained in:
+6
-2
@@ -16,9 +16,13 @@ http {
|
||||
# Proxy Cache storage - so we can cache the DoH response from the upstream
|
||||
proxy_cache_path /var/cache/nginx/doh_cache levels=1:2 keys_zone=doh_cache:10m;
|
||||
|
||||
real_ip_header proxy_protocol;
|
||||
real_ip_recursive on;
|
||||
set_real_ip_from 10.10.0.10;
|
||||
|
||||
server {
|
||||
listen 80 default_server;
|
||||
listen 443 ssl http2 default_server;
|
||||
listen 443 ssl http2 default_server proxy_protocol;
|
||||
ssl_certificate /certs/self_public;
|
||||
ssl_certificate_key /certs/self_private;
|
||||
|
||||
@@ -66,7 +70,7 @@ http {
|
||||
# server_name ;
|
||||
#-domain
|
||||
#-ssl
|
||||
# listen 443 ssl http2;
|
||||
# listen 443 ssl http2 proxy_protocol;
|
||||
# ssl_certificate /certs/cert_public;
|
||||
# ssl_certificate_key /certs/cert_private;
|
||||
#-ssl
|
||||
|
||||
@@ -16,9 +16,13 @@ http {
|
||||
# Proxy Cache storage - so we can cache the DoH response from the upstream
|
||||
proxy_cache_path /var/cache/nginx/doh_cache levels=1:2 keys_zone=doh_cache:10m;
|
||||
|
||||
real_ip_header proxy_protocol;
|
||||
real_ip_recursive on;
|
||||
set_real_ip_from 10.10.0.10;
|
||||
|
||||
server {
|
||||
listen 80 default_server;
|
||||
listen 443 ssl http2 default_server;
|
||||
listen 443 ssl http2 default_server proxy_protocol;
|
||||
ssl_certificate /certs/self_public;
|
||||
ssl_certificate_key /certs/self_private;
|
||||
|
||||
@@ -66,7 +70,7 @@ http {
|
||||
# server_name ;
|
||||
#-domain
|
||||
#-ssl
|
||||
# listen 443 ssl http2;
|
||||
# listen 443 ssl http2 proxy_protocol;
|
||||
# ssl_certificate /certs/cert_public;
|
||||
# ssl_certificate_key /certs/cert_private;
|
||||
#-ssl
|
||||
|
||||
@@ -30,6 +30,7 @@ stream {
|
||||
server {
|
||||
listen 443 reuseport;
|
||||
proxy_pass $sni_name;
|
||||
proxy_protocol on;
|
||||
ssl_preread on;
|
||||
}
|
||||
|
||||
|
||||
@@ -204,6 +204,8 @@ services:
|
||||
networks:
|
||||
default:
|
||||
ipv4_address: 10.10.0.5
|
||||
cap_add:
|
||||
- NET_ADMIN
|
||||
command: ["/bin/sh", "/start_ad.sh"]
|
||||
logging: *default-logging
|
||||
ss:
|
||||
|
||||
@@ -19,6 +19,8 @@ ss: # консоль сервиса
|
||||
docker compose exec ss /bin/sh
|
||||
ng: # консоль сервиса
|
||||
docker compose exec ng /bin/sh
|
||||
up: # консоль сервиса
|
||||
docker compose exec up /bin/sh
|
||||
ad: # консоль сервиса
|
||||
docker compose exec ad /bin/sh
|
||||
proxy: # консоль сервиса
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
route add -net 10.0.1.0 netmask 255.255.255.0 gw wg
|
||||
cat /ssh/key.pub > /root/.ssh/authorized_keys
|
||||
ssh-keygen -A
|
||||
exec /usr/sbin/sshd -D -e "$@" &
|
||||
|
||||
+2
-2
@@ -6,8 +6,8 @@ then
|
||||
echo "PrivateKey = $PRIVATEKEY" >> /etc/wireguard/wg0.conf
|
||||
echo "Address = $ADDRESS" >> /etc/wireguard/wg0.conf
|
||||
echo "ListenPort = $WGPORT" >> /etc/wireguard/wg0.conf
|
||||
echo "PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -t nat -A POSTROUTING -o $INTERFACE -j MASQUERADE" >> /etc/wireguard/wg0.conf
|
||||
echo "PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -t nat -D POSTROUTING -o $INTERFACE -j MASQUERADE" >> /etc/wireguard/wg0.conf
|
||||
echo "PostUp = iptables -t nat -A POSTROUTING --destination 10.10.0.5 -j ACCEPT;iptables -t nat -A POSTROUTING -o $INTERFACE -j MASQUERADE" >> /etc/wireguard/wg0.conf
|
||||
echo "PostDown = iptables -t nat -D POSTROUTING --destination 10.10.0.5 -j ACCEPT;iptables -t nat -D POSTROUTING -o $INTERFACE -j MASQUERADE" >> /etc/wireguard/wg0.conf
|
||||
fi
|
||||
sed "s/ListenPort = [0-9]\+/ListenPort = $WGPORT/" /etc/wireguard/wg0.conf > change_port
|
||||
cat change_port > /etc/wireguard/wg0.conf
|
||||
|
||||
Reference in New Issue
Block a user