Just some small custom changes. Thanks margau for the idea and implementation
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Hendrik Schutter a3541411c3
added mkdir
10 months ago
snippets custom changes 1 year ago
README.md added mkdir 10 months ago
example-vhost.conf custom changes 1 year ago


LegacyIP Warn

Fork from: https://gitlab.com/margau_me/legacyip-warn

This project allows you to inject an warning banner for IPv4-users with a NGINX webserver.

It consists of two snippets and an example vhost configuration.

Blog Post: https://margau.net/posts/2020-09-06-legacyip-warn/


mkdir /etc/nginx/snippets

copy legacy-banner.conf to /etc/nginx/snippets/legacy-banner.conf

copy legacy-js.conf to /etc/nginx/snippets/legacy-js.conf

Add the script to the site config like this:

            geo $ipv4 {
            server {
                #Listen SSL+HTTP/2
                listen 443 ssl http2;
                listen [::]:443 ssl http2;

                #Server Name here

                include /etc/nginx/snippets/legacy-js.conf;

                location / {
	            #normal location or proxy settings

            	# IP Legacy Banner
	            include /etc/nginx/snippets/legacy-banner.conf;
	            if ($ipv4 ~ "^$") {
                    set $legacy "<!-- uses IPv6 --></body>";
	            sub_filter "script-src 'unsafe-inline' 'unsafe-inline'" "script-src 'unsafe-inline'";
	            sub_filter "</body>" $legacy;

Du besuchst diese Seite mit einem veralteten IPv4-Internetzugang. Möglicherweise treten in Zukunft Probleme mit der Erreichbarkeit und Performance auf. Bitte frage deinen Internetanbieter oder Netzwerkadministrator nach IPv6-Unterstützung.
You are visiting this site with an outdated IPv4 internet access. You may experience problems with accessibility and performance in the future. Please ask your ISP or network administrator for IPv6 support.
Weitere Infos | More Information
Klicke zum schließen | Click to close