aboutsummaryrefslogtreecommitdiffstats
path: root/hosts/arrakis/services.nix
diff options
context:
space:
mode:
Diffstat (limited to 'hosts/arrakis/services.nix')
-rw-r--r--hosts/arrakis/services.nix15
1 files changed, 14 insertions, 1 deletions
diff --git a/hosts/arrakis/services.nix b/hosts/arrakis/services.nix
index 400e80c..9a0f4b8 100644
--- a/hosts/arrakis/services.nix
+++ b/hosts/arrakis/services.nix
@@ -85,6 +85,14 @@
};
nginx = {
+ appendHttpConfig = ''
+ geo $geo {
+ default 0;
+ 127.0.0.1 1;
+ ::1 1;
+ 192.168.1.0/24 1;
+ }
+ '';
enable = true;
# Use recommended settings
@@ -98,8 +106,13 @@
virtualHosts = {
"arrakis.bitgnome.net" = {
+ addSSL = true;
enableACME = true;
- forceSSL = true;
+ extraConfig = ''
+ if ($geo = 0) {
+ return 301 https://$host$request_uri;
+ }
+ '';
locations = {
"/" = {
tryFiles = "$uri $uri/ =404";