placing a shiny app inside an iframe

Hi,

I know similar questions have been asked but I think mine comes with a twist. Due to the nature of the app I cannot use shinyapps.io (some sensitive data). What I would like to do is to have couple of static websites and a website that is nothing but an I frame.

Inside the iframe I will put the shiny app. All the answers I have seen so far say that I need to host it at a different place and then place the link in the iframe. I would like to host the static pages and the app on the same machine and preferable use nginx to deliver the app to the outside world.

Thanks and I appreciate all the help.

You can host both on the same machine but using two different services, the static content could be served from nginx directly, but the shiny app has to be served necessarily from shiny-server, since both are on the same machine, you could define a path to the shiny app or an http address pointing to the port 3838 in your iframe

<iframe src="/srv/shiny-server/sample-apps/hello/" style="border: 1px solid #AAA; width: 290px; height: 460px"></iframe>

Hi @acelik,

As described by @andresrcs this is definitely possible and I often do that:

  • my apps are in the shiny server or rstudio connect either on port 3838 or 3939 by default, respectively. For shiny server they are by default in /srv/shiny-server, even though this could be customized...
  • the Nginx or Apache2 server is on port 80, by default. The html content is in /var/www/html. This is were you would have your custom index.html page containing some iframes for your shiny apps as well as your css and JavaScript assets.

An example is what I did with the RinteRface website https:///rinterface.com. The showcase is a bootstrap 4 carousel containing iframes of shinyapps.

Should you need a fullscreen iframe, you can proceed with WebSlides https://webslides.tv, generate only 1 slide where the content is on fullscreen mode.

Thanks everyone for the suggestions. I will start trying the suggested solutions and will update if things are working.

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.