summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorKjetil Orbekk <kjetil.orbekk@gmail.com>2017-05-20 18:21:25 -0400
committerKjetil Orbekk <kjetil.orbekk@gmail.com>2017-05-20 18:21:25 -0400
commit8baa869f24d5641a6f61d197f6311caeb6495266 (patch)
tree34e79cce28ea028b81f729ef4d4ec7f4a37f6674 /config
parent28b9c9ae0e4898b0be61afa58300d03f0f4906f7 (diff)
shape: Add webserver.
Diffstat (limited to 'config')
-rw-r--r--config/web-server.nix54
1 files changed, 54 insertions, 0 deletions
diff --git a/config/web-server.nix b/config/web-server.nix
new file mode 100644
index 0000000..e40cbce
--- /dev/null
+++ b/config/web-server.nix
@@ -0,0 +1,54 @@
+{ config, lib, pkgs, ... }:
+{
+ services.nginx = {
+ enable = true;
+ recommendedProxySettings = true;
+ appendHttpConfig = ''
+ # This is a workaround to deal with closed connections on
+ # large downloads.
+ proxy_buffering off;
+ '';
+ virtualHosts = {
+ "orbekk.com" = {
+ enableACME = true;
+ forceSSL = true;
+ root = "/srv/www/orbekk";
+ };
+ "semeai.orbekk.com" = {
+ enableACME = true;
+ forceSSL = true;
+ root = "/srv/www/orbekk";
+ };
+ "kj.orbekk.com" = {
+ enableACME = true;
+ forceSSL = true;
+ locations."/".proxyPass = "http://10.0.20.11:8011";
+ locations."/hledger" = {
+ extraConfig = ''return 302 /hledger/;'';
+ };
+ # locations."/hledger/" = {
+ # proxyPass = "http://localhost:5000/";
+ # extraConfig = ''
+ # auth_basic "hledger";
+ # auth_basic_user_file /opt/site/hledger-htpasswd;
+ # '';
+ # };
+ locations."/_matrix" = {
+ proxyPass = "http://10.0.20.15:11102";
+ };
+ };
+ "git.orbekk.com" = {
+ enableACME = true;
+ forceSSL = true;
+ locations."/".proxyPass = "http://10.0.20.15:11103";
+ };
+ "hydra.orbekk.com" = {
+ enableACME = true;
+ forceSSL = true;
+ locations."/" = {
+ proxyPass = "http://10.0.20.15:11101";
+ };
+ };
+ };
+ };
+}