Port Forwarding HTTP 8080 to HTTPS 443 Domain

Hi
For instance I use my main apache server on my linux server on port 80 without any problems.

A Spring-Boot is running on port 8080 which is also available via HTTP not HTTPS. I need it running on https://s.example.com/

On my projects, where I don’t use cloudflare, I add a .conf file to my Liunx’ apache server, which can for example forward https://s.example.com/ to localhost:8080, without any problems. This same config is not working for cloudflare, and I think this is because Cloudflare doesn’t let the server know, that the request is coming from https://s.example.com/ and therefore the server is showing the default site.

The goal is just to let https://s.example.com/ to show data, which spring-boot delivers.

This is the .conf file from apache2, which has worked fine on non-cloudflare domains.

<VirtualHost *:80>
    ServerAdmin [email protected]
    ServerName s.example.com
    ProxyPreserveHost On

    # setup the proxy
    <Proxy *>
        Order allow,deny
        Allow from all
    </Proxy>
    ProxyPass / http://localhost:8080/
    ProxyPassReverse / http://localhost:8080/

    RewriteEngine on
    RewriteCond %{REQUEST_URI} !^/web
    RewriteCond %{HTTP:X-Plex-Device} ^$
    RewriteRule ^/$ /web/$1 [R,L]
</VirtualHost>

<VirtualHost *:443>
    ServerAdmin [email protected]
    ServerName s.example.com
    ProxyPreserveHost On

    # setup the proxy
    <Proxy *>
        Order allow,deny
        Allow from all
    </Proxy>
    ProxyPass / http://localhost:8080/
    ProxyPassReverse / http://localhost:8080/
</VirtualHost>

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.