Fix nginx for spacebar
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;";
};
}
|