skip to Main Content

My shiny server runs on my VPS without any issues (on Ubuntu, via Apache). So that’s great. 🙂 However, what I now try to achieve is the following (sorry for not using the correct terminology here, this is new for me):

Instead of sharing my apps via https://www.example.com:3838/appname, I would like to use https://www.example.com/appname (is this called port forwarding? aka ‘getting rid of port 3838’).

It is important to note that I do not want the shiny server to ‘take over’ my homepage as https://www.example.com serves my own personal site.

I tried the codeblock shared by Chris Beeley to be included in /etc/apache2/sites-enabled/000-default-le-ssl.conf, but that does not work. However, what does work to some degree is if I adjust the code as follows

Original code

ProxyPreserveHost On
ProxyPass /shinyapps http://0.0.0.0:3838/shinyapps
ProxyPassReverse /shinyapps http://0.0.0.0:3838/shinyapps
ServerName localhost

Adjusted code

ProxyPreserveHost On
ProxyPass /foo http://0.0.0.0:3838/foo
ProxyPassReverse /foo http://0.0.0.0:3838/foo
ServerName localhost

Yes, my app called foo can now be reached by www.example.com/foo; but this implies that I need to add the names of all my apps in this codeblock.

Any suggestions? Thank you.

Also, I am sorry if this question turns out to be duplicate.

PS. All incoming connections to http are already redirected to https

2

Answers


  1. That should work:

    ProxyPreserveHost On
    ProxyPass /(.*)$ http://0.0.0.0:3838/$1
    ProxyPassReverse /(.*)$ http://0.0.0.0:3838/$1
    ServerName localhost
    

    Check out this link: https://httpd.apache.org/docs/trunk/rewrite/intro.html

    Login or Signup to reply.
  2. I think you’ve misunderstood the way the URLs are structured. You need to point to

    ProxyPass /foo http://0.0.0.0:3838/foo
    

    As you have done, but foo is the name of the directory of apps.

    So take all the application folders that you have, and put them inside foo.

    Now the URL will be

    https://example.org/foo/app1
    https://example.org/foo/app2
    

    Etc.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search