🎨 enable externalTrafficPolicy: Local option to forward external IP

This commit is contained in:
2024-07-29 14:16:43 +01:00
parent 0f6eb95f20
commit 05fc32f18a
16 changed files with 324 additions and 221 deletions
+26 -21
View File
@@ -1,40 +1,45 @@
############################################
# config file for router
############################################
upstream router_backend {
server 192.168.88.1;
server 1.1.1.1 backup;
server 192.168.88.1;
server 1.1.1.1 backup;
}
server {
server_name router.tryton.geeraert.eu www.router.tryton.geeraert.eu;
server_name router.tryton.geeraert.eu www.router.tryton.geeraert.eu;
location / {
proxy_pass http://router_backend;
proxy_pass http://router_backend;
proxy_set_header Upgrade $http_upgrade;
auth_basic "Administrator’s Area";
auth_basic_user_file /authentication-htpasswd/.htpasswd;
}
location /.well-known/acme-challenge/ {
root /var/www/certbot;
root /var/www/certbot;
}
listen 443 ssl; # managed by Certbot
listen 443 ssl;
ssl_certificate /etc/nginx/ssl/live/tryton.geeraert.eu/fullchain.pem;
ssl_certificate_key /etc/nginx/ssl/live/tryton.geeraert.eu/privkey.pem;
#include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
#ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = www.router.tryton.geeraert.eu) {
return 301 https://$host$request_uri;
} # managed by Certbot
if ($host = www.router.tryton.geeraert.eu) {
return 301 https://$host$request_uri;
}
if ($host = router.tryton.geeraert.eu) {
return 301 https://$host$request_uri;
} # managed by Certbot
if ($host = router.tryton.geeraert.eu) {
return 301 https://$host$request_uri;
}
server_name www.router.tryton.geeraert.eu router.tryton.geeraert.eu;
listen 80;
return 404; # managed by Certbot
listen 80;
return 404;
}