{ config, lib, pkgs, ... }: with lib; let domain = "yugoslavia.best"; root = "/var/www/${domain}"; in { config = { modules.services.staticSites.${domain} = { dataDir = root; php = true; forceSSL = false; }; services = { nginx.virtualHosts.${domain} = { locations."/" = { extraConfig = '' error_page 404 /error.php; ''; }; locations."= /brackets2.html" = { extraConfig = '' return 451; ''; }; locations."/modding-txts/" = { extraConfig = '' autoindex on; sub_filter ''; sub_filter
 ' ';
            sub_filter 
' '; sub_filter '' ''; sub_filter '' '
'; sub_filter '
'; sub_filter
'
'; sub_filter_once off; ''; }; locations."/srb2kaddons/" = { extraConfig = '' autoindex on; alias /var/lib/srb2k/firepit/; sub_filter ''; sub_filter
 ' ';
            sub_filter 
' '; sub_filter '' ''; sub_filter '' '
'; sub_filter '
'; sub_filter
'
'; sub_filter_once off; ''; }; locations."/__special" = { extraConfig = '' internal; allow all; root ${root}/nginx/html/__special; ''; }; locations."= /__md_file" = { extraConfig = '' internal; allow all; add_header 'Vary' 'Accept'; # redefining add_header Strict-Transport-Security $hsts_header; add_header Referrer-Policy origin-when-cross-origin; add_header X-Content-Type-Options nosniff; add_header X-XSS-Protection "1; mode=block"; sub_filter '$request_filename - yugoslavia.best'; sub_filter_once on; default_type text/html; alias ${root}/nginx/html/__special/md-renderer.html; ''; }; locations."~* \\.md" = { extraConfig = '' error_page 418 = /__md_file; add_header 'Vary' 'Accept'; # redefining add_header Strict-Transport-Security $hsts_header; add_header Referrer-Policy origin-when-cross-origin; add_header X-Content-Type-Options nosniff; add_header X-XSS-Protection "1; mode=block"; if (!-f $request_filename) { break; } # if no "text/markdown" in "accept" header: # redirect to /__md_file to serve html renderer if ($http_accept !~* "text/markdown") { return 418; } ''; }; extraConfig = '' types { text/plain md; text/html html; text/plain txt; text/css css; application/javascript js; image/x-icon ico; image/png png; image/gif gif; } ''; }; }; }; }