Gadg3ts
(Sean Meacher)
2
So I’ve solved my own problem with an nginx ‘if’ statement for the non-https server block…
Basically, if the user agent string is the one from the emontx, proxy to the docker instance of emoncms.
If it isn’t that device, redirect to https as normal.
This thing seems to have trouble with nested curly brackets, so you essentially put the following in the server block for port 80:
if ($http_user_agent != “ESP8266HTTPClient” ) {
return 301 https://$host$request_uri;
}
1 Like