legacyip-warn/example-vhost.conf
2020-09-06 20:07:24 +02:00

27 lines
534 B
Plaintext

geo $ipv4 {
0.0.0.0/0 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 / {
proxy_pass (...);
include /etc/nginx/proxy_params.conf;
# IP Legacy Banner
sub_filter_types text/html;
include /etc/nginx/snippets/legacy-banner.conf;
if ($ipv4 ~ "^$") {
set $legacy "<!-- uses IPv6 --></body>";
}
sub_filter "script-src 'unsafe-inline'" "script-src 'unsafe-inline'";
sub_filter "</body>" $legacy;
}
}