Skip to content

Instantly share code, notes, and snippets.

@kalbasit
Last active July 20, 2021 17:58
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kalbasit/9cf9b23f2e0f70c285d0 to your computer and use it in GitHub Desktop.
Save kalbasit/9cf9b23f2e0f70c285d0 to your computer and use it in GitHub Desktop.
DSM Allow custom domain for Photo Station
diff --git a/usr/syno/share/nginx/Photo.mustache b/usr/syno/share/nginx/Photo.mustache
new file mode 100644
index 0000000..54043ff
--- /dev/null
+++ b/usr/syno/share/nginx/Photo.mustache
@@ -0,0 +1,19 @@
+server {
+ listen 80;
+ listen [::]:80;
+ listen 443 ssl;
+ listen [::]:443 ssl;
+
+ server_name photos.example.com;
+
+ location = / {
+ {{#DSM.ssl}}
+ if ($scheme = https) {
+ rewrite / https://$host/photo/ redirect;
+ }
+ {{/DSM.ssl}}
+ rewrite / http://$host/photo/ redirect;
+ }
+
+ include /usr/local/etc/nginx/conf.d/www.PhotoStation.conf;
+}
diff --git a/usr/syno/share/nginx/nginx.mustache b/usr/syno/share/nginx/nginx.mustache
index e10aec4..d42b1de 100644
--- a/usr/syno/share/nginx/nginx.mustache
+++ b/usr/syno/share/nginx/nginx.mustache
@@ -56,6 +56,7 @@ http {
index index.html index.htm index.php;
+ {{> /usr/syno/share/nginx/Photo}}
{{> /usr/syno/share/nginx/DSM}}
{{> /usr/syno/share/nginx/WWWService}}
{{> /usr/syno/share/nginx/Portal}}
@TroySi
Copy link

TroySi commented Jan 23, 2017

Any way you can provide some details about what this is? I'm not at all familiar with hat I'm looking at here, but I would like to accomplish what is stated in the title.

@riordan
Copy link

riordan commented Mar 7, 2019

More context is this original forum post

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment