use error_page instead of try_files?????
This commit is contained in:
parent
13d55d7293
commit
89c40d8046
|
@ -10,12 +10,17 @@ with lib; let
|
|||
pkgs.piped-frontend.override {backendDomain = cfg.backendDomain;};
|
||||
in {
|
||||
config = mkIf (cfg.enable && !cfg.disableFrontend && !cfg.disableNginx) {
|
||||
# https://github.com/TeamPiped/Piped/blob/master/docker/nginx.conf
|
||||
services.nginx.virtualHosts."${cfg.frontendDomain}" = {
|
||||
forceSSL = cfg.nginxForceSSL;
|
||||
enableACME = cfg.nginxEnableACME;
|
||||
locations."/".root = "${frontend-package}/share/piped-frontend";
|
||||
locations."/" = {
|
||||
root = "${frontend-package}/share/piped-frontend";
|
||||
index = "index.html index.htm";
|
||||
};
|
||||
# I have no idea why try_files for Single Page Apps doesn't work here
|
||||
extraConfig = ''
|
||||
try_files $uri $uri/ /index.html;
|
||||
error_page 404 =200 /index.html;
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
|
|
@ -94,20 +94,12 @@ in {
|
|||
};
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts."piped.owo.monster" = let
|
||||
backendDomain = "backend.piped.owo.monster";
|
||||
frontend-package = pkgs.piped-frontend.override {
|
||||
inherit backendDomain;
|
||||
};
|
||||
in {
|
||||
services.nginx.virtualHosts."piped.owo.monster" = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://unix:${pipedSocketForComponent "frontend"}";
|
||||
};
|
||||
extraConfig = ''
|
||||
try_files $uri $uri/ /index.html;
|
||||
'';
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts."backend.piped.owo.monster" = {
|
||||
|
|
Loading…
Reference in a new issue