mirror of
https://github.com/RGBCube/Site
synced 2025-08-01 13:37:49 +00:00
Fix proxyPass directives and redirect www to root and any other tld that doesn't match anything to 404
This commit is contained in:
parent
ece0da0f65
commit
0c16c81c2a
1 changed files with 19 additions and 1 deletions
20
flake.nix
20
flake.nix
|
@ -153,7 +153,25 @@
|
||||||
enableACME = true;
|
enableACME = true;
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
|
|
||||||
proxyPass = "http://127.0.0.1:${cfg.port}";
|
locations."/".proxyPass = "http://localhost:${cfg.port}";
|
||||||
|
};
|
||||||
|
|
||||||
|
virtualHosts."www.${urlStripped}" = {
|
||||||
|
forceSSL = true;
|
||||||
|
enableACME = true;
|
||||||
|
|
||||||
|
locations."/".extraConfig = ''
|
||||||
|
return 301 https://${urlStripped}$request_uri;
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
virtualHosts._ = {
|
||||||
|
forceSSL = true;
|
||||||
|
useACMEHost = urlStripped;
|
||||||
|
|
||||||
|
locations."/".extraCofig = ''
|
||||||
|
proxy_pass http://localhost:${cfg.port}/404;
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue