1

I need to present a Shiny application (let's call it my_app) through HTTPS.

This is my setup:

  • Public ip address is 1.2.3.4
  • Shiny Server is listening on port 3333
  • I installed nginx to proxy the connections from 443 (https) to localhost:3333
  • I can successfully use the application using http://1.2.3.4:3333/my_app and https://1.2.3.4/my_app

Here is the problem: whenever I use my_app (which is resource-intensitive) and open another tab and try to reach https://1.2.3.4/my_app, I got "502 bad gateway" BUT, if I try to access it via http://1.2.3.4:3333/my_app, it works OK.

Any idea? Thanks

UPDATE

Here is the nginx server error log:

2016/11/15 17:20:30 [error] 28895#0: *414 upstream prematurely closed connection while reading response header from upstream, client: x.x.x.x, server: 1.2.3.4, request: "GET /my_app/ HTTP/1.1", upstream: "http://127.0.0.1:3333/my_app/", host: "1.2.3.4"

2016/11/15 17:22:08 [error] 28895#0: *414 upstream prematurely closed connection while reading response header from upstream, client: x.x.x.x, server: 1.2.3.4, request: "GET /my_app/ HTTP/1.1", upstream: "http://127.0.0.1:3333/my_app/", host: "1.2.3.4"

2016/11/15 17:25:11 [error] 28896#0: *452 upstream prematurely closed connection while reading response header from upstream, client: x.x.x.x, server: 1.2.3.4, request: "GET /my_app/ HTTP/1.1", upstream: "http://127.0.0.1:3333/my_app/", host: "1.2.3.4"

2016/11/15 17:35:55 [error] 28896#0: *558 upstream prematurely closed connection while reading response header from upstream, client: x.x.x.x, server: 1.2.3.4, request: "GET /my_app/ HTTP/1.1", upstream: "http://127.0.0.1:3333/my_app/", host: "1.2.3.4"

  • Check the nginx error log. – Michael Hampton Nov 15 '16 at 16:46
  • updated the question with the erro log from nginx – Delta Nov 15 '16 at 17:03
  • That looks like your app is having a problem, rather than the web server. You should check what it was doing. – Michael Hampton Nov 15 '16 at 17:04
  • thanks for the answer. But when I access shiny-server directly (using the 3333 port) all is fine, so should be something nginx related, I think. – Delta Nov 15 '16 at 17:16
  • Don't assume. Go look and verify that your app isn't having some sort of problem. – Michael Hampton Nov 15 '16 at 17:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.