summary refs log tree commit diff
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2025-12-27 07:23:53 +0100
committerRory& <root@rory.gay>2025-12-27 07:23:53 +0100
commit9b53528b2e60c41ebae683183d220d044155472d (patch)
treea78b2b135fa90ee9f0e0786124aee68f78e495dc
parentUpdate security settings (diff)
downloadRory-Open-Architecture-9b53528b2e60c41ebae683183d220d044155472d.tar.xz
Fix nginx for spacebar
-rw-r--r--host/Rory-ovh/services/nginx/spacebar.chat/server/rory/api.nix18
-rw-r--r--host/Rory-ovh/services/nginx/spacebar.chat/server/rory/cdn.nix18
-rw-r--r--host/Rory-ovh/services/nginx/spacebar.chat/server/rory/gateway.nix18
-rw-r--r--host/Rory-ovh/services/nginx/spacebar.chat/server/rory/root.nix18
4 files changed, 4 insertions, 68 deletions
diff --git a/host/Rory-ovh/services/nginx/spacebar.chat/server/rory/api.nix b/host/Rory-ovh/services/nginx/spacebar.chat/server/rory/api.nix

index 830c84f..00bbc6c 100644 --- a/host/Rory-ovh/services/nginx/spacebar.chat/server/rory/api.nix +++ b/host/Rory-ovh/services/nginx/spacebar.chat/server/rory/api.nix
@@ -4,22 +4,6 @@ addSSL = !config.virtualisation.isVmVariant; locations."/" = { proxyPass = "http://192.168.100.22:3001"; - extraConfig = '' - if ($request_method = 'OPTIONS') { - more_set_headers 'Access-Control-Allow-Origin: *'; - more_set_headers 'Access-Control-Allow-Methods: *'; - # - # Custom headers and headers various browsers *should* be OK with but aren't - # - more_set_headers 'Access-Control-Allow-Headers: *, Authorization'; - # - # Tell client that this pre-flight info is valid for 20 days - # - more_set_headers 'Access-Control-Max-Age: 1728000'; - more_set_headers 'Content-Type: text/plain; charset=utf-8'; - more_set_headers 'Content-Length: 0'; - return 204; - } - ''; + extraConfig = "proxy_ssl_server_name on;" + "proxy_pass_header Authorization;"; }; } diff --git a/host/Rory-ovh/services/nginx/spacebar.chat/server/rory/cdn.nix b/host/Rory-ovh/services/nginx/spacebar.chat/server/rory/cdn.nix
index dbb4331..02894d7 100644 --- a/host/Rory-ovh/services/nginx/spacebar.chat/server/rory/cdn.nix +++ b/host/Rory-ovh/services/nginx/spacebar.chat/server/rory/cdn.nix
@@ -4,22 +4,6 @@ addSSL = !config.virtualisation.isVmVariant; locations."/" = { proxyPass = "http://192.168.100.22:3003"; - extraConfig = '' - if ($request_method = 'OPTIONS') { - more_set_headers 'Access-Control-Allow-Origin: *'; - more_set_headers 'Access-Control-Allow-Methods: *'; - # - # Custom headers and headers various browsers *should* be OK with but aren't - # - more_set_headers 'Access-Control-Allow-Headers: *, Authorization'; - # - # Tell client that this pre-flight info is valid for 20 days - # - more_set_headers 'Access-Control-Max-Age: 1728000'; - more_set_headers 'Content-Type: text/plain; charset=utf-8'; - more_set_headers 'Content-Length: 0'; - return 204; - } - ''; + extraConfig = "proxy_ssl_server_name on;" + "proxy_pass_header Authorization;"; }; } diff --git a/host/Rory-ovh/services/nginx/spacebar.chat/server/rory/gateway.nix b/host/Rory-ovh/services/nginx/spacebar.chat/server/rory/gateway.nix
index c74d7e9..88a37da 100644 --- a/host/Rory-ovh/services/nginx/spacebar.chat/server/rory/gateway.nix +++ b/host/Rory-ovh/services/nginx/spacebar.chat/server/rory/gateway.nix
@@ -5,22 +5,6 @@ locations."/" = { proxyPass = "http://192.168.100.22:3002"; proxyWebsockets = true; - extraConfig = '' - if ($request_method = 'OPTIONS') { - more_set_headers 'Access-Control-Allow-Origin: *'; - more_set_headers 'Access-Control-Allow-Methods: *'; - # - # Custom headers and headers various browsers *should* be OK with but aren't - # - more_set_headers 'Access-Control-Allow-Headers: *, Authorization'; - # - # Tell client that this pre-flight info is valid for 20 days - # - more_set_headers 'Access-Control-Max-Age: 1728000'; - more_set_headers 'Content-Type: text/plain; charset=utf-8'; - more_set_headers 'Content-Length: 0'; - return 204; - } - ''; + extraConfig = "proxy_ssl_server_name on;" + "proxy_pass_header Authorization;"; }; } diff --git a/host/Rory-ovh/services/nginx/spacebar.chat/server/rory/root.nix b/host/Rory-ovh/services/nginx/spacebar.chat/server/rory/root.nix
index 830c84f..00bbc6c 100644 --- a/host/Rory-ovh/services/nginx/spacebar.chat/server/rory/root.nix +++ b/host/Rory-ovh/services/nginx/spacebar.chat/server/rory/root.nix
@@ -4,22 +4,6 @@ addSSL = !config.virtualisation.isVmVariant; locations."/" = { proxyPass = "http://192.168.100.22:3001"; - extraConfig = '' - if ($request_method = 'OPTIONS') { - more_set_headers 'Access-Control-Allow-Origin: *'; - more_set_headers 'Access-Control-Allow-Methods: *'; - # - # Custom headers and headers various browsers *should* be OK with but aren't - # - more_set_headers 'Access-Control-Allow-Headers: *, Authorization'; - # - # Tell client that this pre-flight info is valid for 20 days - # - more_set_headers 'Access-Control-Max-Age: 1728000'; - more_set_headers 'Content-Type: text/plain; charset=utf-8'; - more_set_headers 'Content-Length: 0'; - return 204; - } - ''; + extraConfig = "proxy_ssl_server_name on;" + "proxy_pass_header Authorization;"; }; }