From e7b71eca69121bee45c9eb63edc5b7dd89f78130 Mon Sep 17 00:00:00 2001 From: Gerdriaan Mulder Date: Sat, 9 Nov 2019 22:29:01 +0100 Subject: [PATCH] index templates: assume we run on https. README: example nginx config Fixes #10 --- README.md | 14 ++++++++++++++ assets/templates/html/index.html.tmpl | 4 ++-- assets/templates/txt/index.txt.tmpl | 4 ++-- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f7a3a71..086be37 100644 --- a/README.md +++ b/README.md @@ -105,3 +105,17 @@ header that the client sends. We can still wrap the plain-text page in a single We will try as hard as possible to not store any data about our users, and will only provide any data when we have the legal obligation to do so. +## Sample `nginx` config + +``` +server { + location / { + root /var/www/rushlink; + proxy_pass http://127.0.0.1:8000; + proxy_set_header Host rushlink.local; + proxy_set_header X-Forwarded-For $remote_addr; + proxy_http_version 1.1; + } +} +``` + diff --git a/assets/templates/html/index.html.tmpl b/assets/templates/html/index.html.tmpl index 7b839d7..a182d7f 100644 --- a/assets/templates/html/index.html.tmpl +++ b/assets/templates/html/index.html.tmpl @@ -9,9 +9,9 @@ the command line. ## USAGE # Shorten a URL - curl -F'shorten=http://example.com/some/long/url' {{.Request.Host}} + curl -F'shorten=http://example.com/some/long/url' https://{{.Request.Host}} # Shorten a URL with a token to delete it later - curl -F'shorten=http://example.com/some/long/url' -F'deleteToken=' {{.Request.Host}} + curl -F'shorten=http://example.com/some/long/url' -F'deleteToken=' https://{{.Request.Host}} {{end}} diff --git a/assets/templates/txt/index.txt.tmpl b/assets/templates/txt/index.txt.tmpl index 20b7c15..9dd38e7 100644 --- a/assets/templates/txt/index.txt.tmpl +++ b/assets/templates/txt/index.txt.tmpl @@ -7,7 +7,7 @@ the command line. ## USAGE # Shorten a URL - curl -F'shorten=http://example.com/some/long/url' {{.Request.Host}} + curl -F'shorten=http://example.com/some/long/url' https://{{.Request.Host}} # Shorten a URL with a token to delete it later - curl -F'shorten=http://example.com/some/long/url' -F'deleteToken=' {{.Request.Host}} + curl -F'shorten=http://example.com/some/long/url' -F'deleteToken=' https://{{.Request.Host}}