aboutsummaryrefslogtreecommitdiff
path: root/roles/web/proxy
diff options
context:
space:
mode:
Diffstat (limited to 'roles/web/proxy')
-rw-r--r--roles/web/proxy/default.nix28
1 files changed, 28 insertions, 0 deletions
diff --git a/roles/web/proxy/default.nix b/roles/web/proxy/default.nix
new file mode 100644
index 0000000..879ef12
--- /dev/null
+++ b/roles/web/proxy/default.nix
@@ -0,0 +1,28 @@
+{ config, pkgs, lib, inputs, ... }:
+with lib;
+
+let cfg = config.roles.web.proxy; in {
+ options.roles.web.proxy = {
+ enable = mkEnableOption "nginx reverse proxy";
+ };
+
+ config = mkIf cfg.enable {
+ networking.firewall.allowedTCPPorts = [ 80 ];
+
+ services.nginx = {
+ enable = true;
+ virtualHosts = {
+ "localhost".locations = {
+ "/test" = {
+ recommendedProxySettings = true;
+ proxyPass = "http://192.168.0.2/";
+ };
+ "/stargazers" = {
+ recommendedProxySettings = true;
+ proxyPass = "http://192.168.0.3/";
+ };
+ };
+ };
+ };
+ };
+}