Have a single public IP and multiple backend private IPs to be able to run multiple sites via a reverse proxy thru nginx to Apache backends?

Posted December 6, 2017 3.2k views

I currently have multiple;tiple sites/domains being hosted on a couple droplets with separate external IP’s. I would like to consolidate this into one IP so I have one droplet running NGinx reverse proxy to pass requests off to the Apache servers on the backend droplets. Is there a tutorial for this? Is this doable?

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.

Submit an Answer
3 answers

Yes, in tomcat server.xml you simply specify separate ports, like 8080, 8082, and 8443. You can even have some https and some http running on the same ip.

Sorry spoke too soon, I do not think this is possible unless you are using the dedicated server option.

  • I like to think before I speak.

    • Then again, the image you are on may support it. You should find information on mod_proxy under your http provider, mine is Apache and there is good documentation available on the download site.
      My web server is tomcat and there is further documentation on mod-proxy there. It is in Tomcat that I specified which port is used by each web.
      Perhaps your application servers provide equivalent documents.
      For me Apache is also the provider of SSL services.

no attachment capability here or I would attach the configs that work for this…

  • Furthermore, you may not even need modproxy if your web server support “virtual hosts” as tomcat does. Modproxy will still come in handy to rewrite for example http requests to https, but that will be documented with virtual hosting.