Infini-DL360/web: clean up and remove excess functions
This commit is contained in:
parent
a4351f8edf
commit
4a967770cd
1 changed files with 52 additions and 84 deletions
|
@ -5,14 +5,8 @@
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
|
with common.nginx;
|
||||||
let
|
let
|
||||||
inherit (common.nginx)
|
|
||||||
ssl
|
|
||||||
ssl-optional
|
|
||||||
ssl-inx
|
|
||||||
ssl-inx-optional
|
|
||||||
;
|
|
||||||
|
|
||||||
tryFiles = "$uri $uri.html $uri/ =404";
|
tryFiles = "$uri $uri.html $uri/ =404";
|
||||||
websiteConfig = ''
|
websiteConfig = ''
|
||||||
error_page 403 /403.html;
|
error_page 403 /403.html;
|
||||||
|
@ -25,28 +19,8 @@ let
|
||||||
location ~ "/\..+" { deny all; }
|
location ~ "/\..+" { deny all; }
|
||||||
'';
|
'';
|
||||||
|
|
||||||
mkWebsite =
|
mkRedirect = to: ssl-optional // { globalRedirect = to; };
|
||||||
name:
|
mkTmpRedirect = to: ssl-optional // { locations."/".return = "302 ${to}"; };
|
||||||
ssl
|
|
||||||
// {
|
|
||||||
locations."/" = {
|
|
||||||
root = "/srv/web/${name}";
|
|
||||||
inherit tryFiles;
|
|
||||||
extraConfig = websiteConfig;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
mkRedirect = from: to: ssl-optional // { globalRedirect = to; };
|
|
||||||
|
|
||||||
websites = lib.genAttrs [
|
|
||||||
"inx.moe"
|
|
||||||
"stickers.inx.moe"
|
|
||||||
] mkWebsite;
|
|
||||||
|
|
||||||
redirects = lib.mapAttrs mkRedirect {
|
|
||||||
"nitter.inx.moe" = "twitter.com";
|
|
||||||
"sweedish.fish" = "swedish.fish";
|
|
||||||
};
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
services.nginx.commonHttpConfig = ''
|
services.nginx.commonHttpConfig = ''
|
||||||
|
@ -57,23 +31,20 @@ in
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
services.nginx.virtualHosts =
|
services.nginx.virtualHosts = {
|
||||||
websites
|
"inx.moe" = ssl-inx // {
|
||||||
// redirects
|
locations."/" = {
|
||||||
// {
|
root = "/srv/web/inx.moe";
|
||||||
|
inherit tryFiles;
|
||||||
|
extraConfig = websiteConfig;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"nitter.inx.moe" = mkRedirect "twitter.com";
|
||||||
|
"sweedish.fish" = mkRedirect "swedish.fish";
|
||||||
|
"blahaj.inx.moe" = mkRedirect "swedish.fish";
|
||||||
|
"foxy.software" = mkTmpRedirect "https://inx.moe";
|
||||||
"j.inx.moe" = ssl-inx-optional // {
|
"j.inx.moe" = ssl-inx-optional // {
|
||||||
locations."/" = {
|
locations."/".return = "302 $jump_link";
|
||||||
return = "302 $jump_link";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
"blahaj.inx.moe" = ssl-inx-optional // {
|
|
||||||
locations."/" = {
|
|
||||||
tryFiles = "/Blahaj.png =404";
|
|
||||||
root = ./static;
|
|
||||||
};
|
|
||||||
locations."/buy" = {
|
|
||||||
return = "301 https://www.ikea.com/us/en/p/blahaj-soft-toy-shark-90373590/";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
"swedish.fish" = ssl-optional // {
|
"swedish.fish" = ssl-optional // {
|
||||||
locations."/" = {
|
locations."/" = {
|
||||||
|
@ -110,9 +81,6 @@ in
|
||||||
extraConfig = websiteConfig;
|
extraConfig = websiteConfig;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
"foxy.software" = ssl-optional // {
|
|
||||||
locations."/".return = "301 https://inx.moe";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
services.uwsgi = {
|
services.uwsgi = {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue