title: Shiny server ProxyPass using apache
body: <p>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):</p>
  
  <p>Instead of sharing my apps via <a href="https://www.example.com:3838/appname" rel="nofollow noreferrer">https://www.example.com:3838/appname</a>, I would like to use <a href="https://www.example.com/appname" rel="nofollow noreferrer">https://www.example.com/appname</a> (is this called port forwarding? aka 'getting rid of port 3838').</p>
  
  <p>It is important to note that I do not want the shiny server to 'take over' my homepage as <a href="https://www.example.com" rel="nofollow noreferrer">https://www.example.com</a> serves my own personal site.</p>
  
  <p>I tried the codeblock shared by <a href="https://chrisbeeley.net/?p=1077" rel="nofollow noreferrer">Chris Beeley</a> to be included in <code>/etc/apache2/sites-enabled/000-default-le-ssl.conf</code>, but that does not work. However, what does work to some degree is if I adjust the code as follows</p>
  
  <p><strong>Original code</strong></p>
  
  <pre><code>ProxyPreserveHost On
  ProxyPass /shinyapps http://0.0.0.0:3838/shinyapps
  ProxyPassReverse /shinyapps http://0.0.0.0:3838/shinyapps
  ServerName localhost
  </code></pre>
  
  <p><strong>Adjusted code</strong></p>
  
  <pre><code>ProxyPreserveHost On
  ProxyPass /foo http://0.0.0.0:3838/foo
  ProxyPassReverse /foo http://0.0.0.0:3838/foo
  ServerName localhost
  </code></pre>
  
  <p>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.</p>
  
  <p>Any suggestions? Thank you.</p>
  
  <p>Also, I am sorry if this question turns out to be duplicate.</p>
  
  <p>PS. All incoming connections to <code>http</code> are already redirected to <code>https</code></p>