Jump to content

Hello, I am having trouble setting up a reverse proxy. So one of my websites run on NGINX and the other ones run on Apache2. How can I setup a reverse proxy so when a someone types in a web url to the address bar it leads them to the website? Should I set this reverse proxy with Nginx or Apache2? Also, most people tell me to run both websites on one server, but one of them only runs on Nginx and the other one only runs on Apache2, so I'm kinda stuck here. Also for this reverse proxy what should be the specs of it? I currently have a server that I can virtualize to use as a reverse proxy.

Link to comment
https://linustechtips.com/topic/1115415-reverse-proxy-with-nginxapache2/
Share on other sites

Link to post
Share on other sites

If your websites are already running nginx or Apache, and they are running on different servers that are exposed to the Internet, you don't need a reverse proxy - you just need to point your DNS towards those servers.

 

If you do need a reverse proxy though, I would lean towards nginx, although both will work fine. The nginx beginner guide includes instructions for setting it up as a reverse proxy - you would want to add a server block for each website, and proxy_pass within a location / { ... }  block in each.

 

36 minutes ago, MartinIAm said:

one of them only runs on Nginx and the other one only runs on Apache2, so I'm kinda stuck here

I'm not sure what you mean by this. There are very few things that only one of them can do, so if you have control of the server you should be able to change the server software if you wanted to. There is no need to do that for this though.

HTTP/2 203

Link to post
Share on other sites

You can run both Apache and NGINX on a server at the same time, all you have to do is change the default port for one of them.

Main Rig:-

Ryzen 7 3800X | Asus ROG Strix X570-F Gaming | 16GB Team Group Dark Pro 3600Mhz | Corsair MP600 1TB PCIe Gen 4 | Sapphire 5700 XT Pulse | Corsair H115i Platinum | WD Black 1TB | WD Green 4TB | EVGA SuperNOVA G3 650W | Asus TUF GT501 | Samsung C27HG70 1440p 144hz HDR FreeSync 2 | Ubuntu 20.04.2 LTS |

 

Server:-

Intel NUC running Server 2019 + Synology DSM218+ with 2 x 4TB Toshiba NAS Ready HDDs (RAID0)

Link to post
Share on other sites

1 hour ago, colonel_mortis said:

If your websites are already running nginx or Apache, and they are running on different servers that are exposed to the Internet, you don't need a reverse proxy - you just need to point your DNS towards those servers.

 

If you do need a reverse proxy though, I would lean towards nginx, although both will work fine. The nginx beginner guide includes instructions for setting it up as a reverse proxy - you would want to add a server block for each website, and proxy_pass within a location / { ... }  block in each.

 

I'm not sure what you mean by this. There are very few things that only one of them can do, so if you have control of the server you should be able to change the server software if you wanted to. There is no need to do that for this though.

The servers are already on the internal network, not external. I will look at the guide though.

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×