feat: deployed frontend, postgres, rev-proxy, tailscale config, initialisation scripts
This commit is contained in:
parent
f48059e37e
commit
a24fd5bd93
20 changed files with 413 additions and 262 deletions
33
pkgs/reverse-proxy.nix
Normal file
33
pkgs/reverse-proxy.nix
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
let
|
||||
domain = "hexname.com";
|
||||
in
|
||||
{
|
||||
services.nginx.virtualHosts = {
|
||||
"${domain}" = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
locations."/api" = {
|
||||
proxyPass = "http://127.0.0.1:8080";
|
||||
proxyWebsockets = true;
|
||||
extraConfig = ''
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
# add_header Strict-Transport-Security 'max-age=300; includeSubDomains; preload; always;'
|
||||
'';
|
||||
};
|
||||
locations."/" = {
|
||||
root = "/var/www/hexname/build";
|
||||
tryFiles = "$uri $uri.html $uri/ /200.html";
|
||||
};
|
||||
};
|
||||
"www.${domain}" = { # Redirect www to root
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
globalRedirect = domain;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue