TelethonKids / deploy_shiny_app

Template to deploy Shiny Apps via Docker and ShinyProxy
37 stars 13 forks source link

HTTPS traffic only; Redirect to HTTP to HTTPS #7

Open greenspray opened 4 years ago

greenspray commented 4 years ago

The problem Due to Nginx HTTPS redirection, there may be an issue for people who want to embed apps in the iframe.

Why? With the Nginx configuration in this repo with LetsEncrypt generated SSL certificate, the shinyproxy doesn't detect that the traffic is coming from HTTPs endpoint and continuously redirects to HTTP. This is problematic for Iframe as it doesn't allow redirection to insecure HTTP.

Solution Use the Nginx config listed in here and set useForwardHeaders as they suggest. Note that the server has to be outside proxy. I spent weeks not noticing this small but significant difference. Hope it helps someone in the future like me.

proxy:
  [...]

server:
  useForwardHeaders: true