How to specify frame_options in shiny-server.conf?

742 views
Skip to first unread message

Alexander Poon

unread,
Apr 26, 2017, 1:20:51 PM4/26/17
to Shiny - Web Framework for R

I'm running Shiny Server Open Source on Ubuntu 16.10. My organization's IT department tells me I need to set X-Frame-Options, so following the docs (http://docs.rstudio.com/shiny-server/#frame_options) I edited /etc/shiny-server/shiny-server.conf as follows:

# Instruct Shiny Server to run applications as the user "shiny"

run_as shiny;


# Set x-frame-options

frame_options deny;


# Define a server that listens on port 3838

server {

  listen 3838;


  # Define a location at the base URL

  location / {


    # Host the directory of Shiny Apps stored in this directory

    site_dir /srv/shiny-server;


    # Log all Shiny output to files in this directory

    log_dir /var/log/shiny-server;


    # When a user visits the base URL rather than a particular application,

    # an index of the applications available in this directory will be shown.

    directory_index on;

  }

}


After editing shiny-server.conf I ran sudo systemctl kill -s HUP -kill-who=main shiny-server.

However, when I pull up Developer Tools on my Shiny app, I don't see X-Frame-Options: deny under Response Headers. Is this what I should be looking at to see that I did it right?

I also tried putting frame_options under server and got the same (lack of) result.

Joe Cheng

unread,
Apr 26, 2017, 2:38:11 PM4/26/17
to Alexander Poon, Shiny - Web Framework for R
Yep, that should work. Can you check your /var/log/shiny-server.log to confirm that the config was actually reloaded? It's possible systemctl doesn't actually know the pid of our main process. I usually do sudo pkill -SIGHUP shiny-server instead.

--
You received this message because you are subscribed to the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shiny-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/shiny-discuss/94b30451-3654-4d4b-8174-7f127e0cc884%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Alexander Poon

unread,
Apr 26, 2017, 3:01:12 PM4/26/17
to Shiny - Web Framework for R, alexand...@gmail.com
/var/log/shiny-server.log shows

[ERROR] shiny-server - Error loading config: Unknown directive "frame_options" (/etc/shiny-server/shiny-server.conf:5:1)


I ran sudo pkill -SIGHUP shiny-server as well but in checking the shiny-server.log file afterward, it shows the same error.

Joe Cheng

unread,
Apr 26, 2017, 4:41:54 PM4/26/17
to Alexander Poon, Shiny - Web Framework for R
Oh, I didn't realize you were on the open source version. I think frame_options is currently only recognized in Shiny Server Pro. I'll backport it to Shiny Server Open Source for the next release. If you're on a deadline, let me know.

Alexander Poon

unread,
Apr 28, 2017, 11:38:19 AM4/28/17
to Shiny - Web Framework for R, alexand...@gmail.com
Understood. Thanks very much!

Raj Patrao

unread,
Jun 27, 2017, 7:10:36 AM6/27/17
to Shiny - Web Framework for R, alexand...@gmail.com
Hi Joe, is this change done yet ? when can we expect a patch for this and how can we pull it into RStudio env ? 

jiger...@ascentius.com

unread,
Jul 11, 2017, 6:39:51 AM7/11/17
to Shiny - Web Framework for R, alexand...@gmail.com
Hi,

Can you please suggest an alternative for disabling the x-frames in shiny open version until the same functionality is rolled out for Shiny Open source?

Regards,
Jiger


On Thursday, April 27, 2017 at 2:11:54 AM UTC+5:30, Joe Cheng [RStudio] wrote:

Joe Cheng [RStudio]

unread,
Jul 17, 2017, 2:38:18 PM7/17/17
to Shiny - Web Framework for R, alexand...@gmail.com
The new version is coming very soon--hopefully this week.

Karthik Raja

unread,
May 2, 2019, 6:20:08 AM5/2/19
to Shiny - Web Framework for R
Was the new version released to enable the embed options of open source Shiny page?

regards

Joe Cheng

unread,
May 6, 2019, 1:49:04 PM5/6/19
to Karthik Raja, Shiny - Web Framework for R
Yes, any version of SSOS >= 1.5.4 should have it.

--
You received this message because you are subscribed to the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shiny-discus...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages