@drwho @kkarhan i use nginx and a few if blocks (yes i'm aware if is evil but to the best of my knowledge if is the only way to get a boolean AND expression)
set $redir_to_gz 1;if ($host = gz.niko.lgbt) {
set $redir_to_gz 0;
}
if ($http_user_agent !~* (claudebot|ZoominfoBot|GPTBot|SeznamBot|DotBot|Amazonbot|DataForSeoBot|2ip|paloaltonetworks.com|SummalyBot|incestoma)) {
set $redir_to_gz 0;
}
if ($redir_to_gz) {
return 301 https://gz.niko.lgbt/;
}
as for the actual stuff behind gz.niko.lgbt
server {# SSL and listen -- snipped
# static files
root /var/www/gz.niko.lgbt;
location / {
add_header Content-Encoding gzip;
try_files /42.gz =404;
gunzip off;
types { text/html gz; }
}
# additional config -- snipped
}
gunzip off is very important because if the client doesn't support gzip encoding nginx will blow its foot off without that
42.gz is generated with dd if=/dev/zero bs=1M count=102400 | gzip -c - > 42.gz