It's possible to hide the port number of a webapp (Tomcat)

Hi all:

I search over the forum but cannot find the answer (maybe I do not know the rights words to ask or search)…

I have an account running on a linux machine and apache and behind a tomcat server with webapplications. The thing is that I need to hide the port number on the app e.g. the app is running on

It is possible to hide the port via Cloudflare? in order to always show the url as


Yep, that’s called ‘reverse proxy’

Your app will be available on port 80/443 and Apache, or nginx will proxy this requests to any port you like.

1 Like

Dear Mark:

Thanks a lot for your reply. But then your answer is that there is no option at Cloudflare to doing that reverse-proxy?

Thanks again,

This Workers code might do it. I think I stole it from @matteo

addEventListener('fetch', event => {

 * Fetch and log a request
 * @param {Request} request
async function changePort(request) {
  var newURL = new URL(request.url)
  newURL.port = '8443'

  return fetch(newURL, request)

Thief! :stuck_out_tongue_winking_eye:


So, then… thanks to both of you! :smile:


Nah, just me. I got rid of the evidence. You’re welcome!

1 Like


1 Like

This topic was automatically closed after 30 days. New replies are no longer allowed.