I have an HTTPS server made in JavaScript running on port 443 directly (not the best idea, but whatever).

I would like to add an onion domain to this, how should I go about getting the data from the HTTPS server already running through the onion service? The server returns modified versions of HTML pages, so accessing files directly isn't an option.

Running Ubuntu 20.04.

Thanks in advance :)

1 Answer 1


Just like this:

  • Your NodeJS/Javascript site is working on the without any SSL/HTTPS
  • Your NGinx is running as a reverse proxy with HTTPS + HTTP/2.0 on and tunneling the requests to and also NGinx on to redirect everything to the same hostname but to HTTPS. The server name in both server {} blocks is your onion address
  • Your local tor instance has a hidden service with ports 80 and 443 tunneled to the port's 80 and 443 respectively - using ports like 8080 and 8443 as some tutorials are suggesting can cause a mess in HTML pipelining

That's it, no rocket science! Make extra sure to bind NGinx to the specific ip+port combo via listen directives and there's no default server bindings.

You may also want to send the header Onion-Location: yoursite.onion to alert the tor browser that an onion URL is available.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.