about summary refs log tree commit diff
path: root/modules
diff options
context:
space:
mode:
authorPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2024-10-17 10:33:33 +0200
committerPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2024-10-17 10:33:33 +0200
commit493286b7a4cab4616d9936fbed8586aacd152c71 (patch)
treef1b46eae80b0753ea3b9c664bad24c1b0fd1371c /modules
parent64b853f016686efc2a14b20bef318ea322e8d370 (diff)
downloaddots-493286b7a4cab4616d9936fbed8586aacd152c71.tar.gz
dots-493286b7a4cab4616d9936fbed8586aacd152c71.zip
t14: 85 current 2024-10-17 10:33:20 24.05.20241004.6e6b3dd 6.6.54 *
Diffstat (limited to 'modules')
-rw-r--r--modules/obsidian-livesync.nix13
1 files changed, 9 insertions, 4 deletions
diff --git a/modules/obsidian-livesync.nix b/modules/obsidian-livesync.nix
index 7bbde9d..075c40a 100644
--- a/modules/obsidian-livesync.nix
+++ b/modules/obsidian-livesync.nix
@@ -42,10 +42,15 @@ in
 				locations."/" = {
 					proxyPass = "http://127.0.0.1:${toString couchdb-port}";
 			        	extraConfig = ''
-					 	proxy_set_header Host "$host";
-					 	proxy_set_header X-Real-IP "$remote_addr";
-					 	proxy_set_header X-Forwarded-For "$proxy_add_x_forwarded_for";
-					 	proxy_set_header X-Forwarded-Proto "$scheme";
+						proxy_set_header Host "$host";
+						proxy_set_header X-Real-IP "$remote_addr";
+						proxy_set_header X-Forwarded-For "$proxy_add_x_forwarded_for";
+						proxy_set_header X-Forwarded-Proto "$scheme";
+					        add_header Access-Control-Allow-Origin "app://obsidian.md";
+						add_header Access-Control-Allow-Methods "GET, POST, PUT, DELETE, OPTIONS";
+						add_header Access-Control-Allow-Headers "Content-Type, Authorization";
+						add_header Access-Control-Allow-Credentials "true";
+						add_header Access-Control-Max-Age 86400
 					'';
 				};
 			};