Question

What is the best way secure traffic from one droplet running NGINX as a reverse-proxy to tomcat on another droplet over 'private' network?

Currently, I’m using the latest CentOS, but is not really a CentOS question.

Droplet A: NGINX acting as a reverse proxy serves https requests

Droplet B: Apache Tomcat (my java web server) running on port 80.

Historically when I was not on Digital Ocean, I had physical security and I connected over port 80 between my backend servers

At Digital Ocean, there is not a true ‘private’ network. Only private within Digital Ocean’s thousands of clients.

Some people have mentioned the following:

  1. IPSec using Strong Swan or something similar
  2. Using Tomcat’s cryptography (I’m not sure how fast java is at cryptography)
  3. SSL Tunneling (We’ve used autossh for less critical things, but doesn’t feel right here)
  4. Running NGINX in front of the tomcat. (Installling another NGINX instance on Droplet B in front of tomcat)

What is the best way to secure and not compromise performance?


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Any of these options should work. #4 would likely be the easiest to implement if you have not previously worked wit Tomcat’s cryptography. I have no data to back this up but 2 and 3 would likely be the fastest but #4 would provide the option for a cache if it would provide any value in your configuration.