Skip to content

Commit 2fed98a

Browse files
authored
Only set INSECURE_USE_HTTP as last resort
I've changed the explanation for the `INSECURE_USE_HTTP` environment variable. The old first line describing this setting in just one sentence was wrong and the next line basically suggested turning this security feature off in situations where it's not needed. In the nightscout code you check if either the connection is secure by itself or if the X-Forwarded-Proto header is set (which it should be by default in all major reverse proxy applications). It should be unnecessary to change that setting even in a reverse proxy environment.
1 parent 561f42a commit 2fed98a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

README.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,7 @@ $ npm install
148148

149149
## Installation notes for users with nginx or Apache reverse proxy for SSL/TLS offloading:
150150

151-
- Set `INSECURE_USE_HTTP` to `false`, to be able to use non secure HTTP connections to Nightscout server
152-
- Your site redirects insecure connections to `https` by default. If you don't want that and use a Nginx or Apache proxy, set `INSECURE_USE_HTTP` to `true`. This will allow (unsafe) http traffic.
151+
- Your site redirects insecure connections to `https` by default. If you use a reverse proxy like nginx or Apache to handle the connection security for you, make sure it sets the `X-Forwarded-Proto` header. Otherwise nightscout will be unable to know if it was called through a secure connection and will try to redirect you to the https version. If you're unable to set this Header, you can change the `INSECURE_USE_HTTP` setting in nightscout to true in order to allow insecure connections without being redirected.
153152
- In case you use a proxy. Do not use an external network interfaces for hosting Nightscout. Make sure the unsecure port is not available from a remote network connection
154153
- HTTP Strict Transport Security (HSTS) headers are enabled by default, use settings `SECURE_HSTS_HEADER` and `SECURE_HSTS_HEADER_*`
155154
- See [Predefined values for your server settings](#predefined-values-for-your-server-settings-optional) for more details

0 commit comments

Comments
 (0)