Report this

What is the reason for this report?

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

Posted on May 23, 2016
dbm

By dbm

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?



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!

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.

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.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.