rstudio / shiny-server

Host Shiny applications over the web.
https://rstudio.com/shiny/server
Other
718 stars 288 forks source link

Fail to run shiny-server open with ssl behind nginx #237

Open complexly opened 8 years ago

complexly commented 8 years ago

The app works well locally, and can be accessed directly using ip and port.

After diabled websocket in shiny config, the app works well behind nginx without ssl on port 80.

With ssl and nginx, the app turned grey after loading some elements. The status of xhr_streaming is "canceled", and in chrome console SockJS reported channel closed with the following info:

Tue Sep 13 2016 23:21:44 GMT+0800 (中国标准时间) [INF]: Error: WebSocket closed shiny-server-client.min.js:formatted:913 Tue Sep 13 2016 23:21:44 GMT+0800 (中国标准时间) [INF]: Connection closed. Info: {"isTrusted":false} shiny-server-client.min.js:formatted:265 Tue Sep 13 2016 23:21:44 GMT+0800 (中国标准时间) [DBG]: SockJS connection closed shiny-server-client.min.js:formatted:265 Tue Sep 13 2016 23:21:44 GMT+0800 (中国标准时间) [DBG]: Channel 0 is closed shiny-server-client.min.js:formatted:265 Tue Sep 13 2016 23:21:44 GMT+0800 (中国标准时间) [DBG]: Removed channel 0, 0 left

I doubt if something (such as the header?) was changed after nginx, which caused these errors.

My nginx version is 1.10.1, and followed the configuration here: https://support.rstudio.com/hc/en-us/articles/213733868-Running-Shiny-Server-with-a-Proxy

yourindian2007 commented 7 years ago

Any updates?

Receiving the same error whilst when accessing through Internet but working perfectly within Intranet. Used the same config as mentioned in https://support.rstudio.com/hc/en-us/articles/213733868-Running-Shiny-Server-with-a-Proxy Firefox can’t establish a connection to the server at wss://domain.com/uri/sockjs/n=Eyii4caHefC6bLpYOI/675/uk6529nj/websocket. The connection to wss://domain.com/scorecard/sockjs/n=Eyii4caHefC6bLpYOI/675/uk6529nj/websocket was interrupted while the page was loading. Fri Dec 09 2016 12:31:28 GMT+0530 (India Standard Time) [INF]: Error: WebSocket closed shiny-s....min.js (line 1) Fri Dec 09 2016 12:31:28 GMT+0530 (India Standard Time) [INF]: Connection closed. Info: {"isTrusted":false} shiny-s....min.js (line 1) Fri Dec 09 2016 12:31:28 GMT+0530 (India Standard Time) [DBG]: SockJS connection closed shiny-s....min.js (line 1) Fri Dec 09 2016 12:31:28 GMT+0530 (India Standard Time) [DBG]: Channel 0 is closed shiny-s....min.js (line 1) Fri Dec 09 2016 12:31:28 GMT+0530 (India Standard Time) [DBG]: Removed channel 0, 0 left shiny-s....min.js (line 1)

paullintilhac commented 7 years ago

Having the same problem here as well. This thread is not very encouraging...

yannrichet commented 7 years ago

see https://groups.google.com/forum/#!topic/shiny-discuss/pOXc_mrBROg in few words : use Ctrl-Shift-Alt-A when looking at the greyed-out screen to check/uncheck each protocol so find the one failing.

travismark commented 7 years ago

try with a version of shiny-server >= 1.5.1. from that version's news:

JoFAM commented 7 years ago

For reference:

I had this problem today with shiny server 1.5.3 and Firefox. Turned out that I missed a slash in the ProxyPass directive in my apache conf file. It said

ProxyPass /mySubfolder http://localhost:3838/mySubfolder

but it should read

ProxyPass /mySubfolder/ http://localhost:3838/mySubfolder/

So if you see this error when talking a proxy, make sure you don't forget these forward slashes in the nginx proxy_redirect statement.