[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 555
  • Last Modified:

Port related query about installing NGINX as a front end proxy for apache on a LAMP installation with Varnish already installed and working

Hi all,

I have apache 2.4 and varnish 4.0 already installed on a Ubuntu 14.04 x64 LAMP system.
Apache2 runs on port 8888 and Varnish runs on port 80 (standard configuration).

I found this tutorial on Digital Ocean: https://www.digitalocean.com/community/tutorials/how-to-configure-nginx-as-a-front-end-proxy-for-apache

I am interested in installing NGINX as front end proxy for apache but I see it needs NGINX to listen to port 80 and apache to listen to port 8080, both of which are occupied at the moment (80 by Varnish and 8080 by ISPConfig3)

My question is, since my apache is already up and running on port 8888, would that mean that my nginx will now need to listen to port 8888 and my apache will need to be on some other port?

thanks in advance
0
badwolfff
Asked:
badwolfff
  • 4
  • 2
1 Solution
 
GaryCommented:
Why would you need nginx as well - bit confusing?
Whats the purpose?

You would be better off just ditching Apache and using nginx
0
 
badwolfffAuthor Commented:
If you read the article you will see why.
Anyway do you know the answer to my query.
I would like to get this stuff working and test it.
If it is not satisfactory, I have a snapshot of my server and I can revert back to it easily.

thanks
0
 
GaryCommented:
Yes I have read and seen that tutorial before.

But there is no benefit as you already have Varnish as the front end proxy.

The only reason for this would be if you didn't already have Varnish and wanted a quicker server for static content.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
GaryCommented:
Anyway you can set nGinx to listen on any port that Varnish is configured to send to
Then in nGinx you just set the port that Apache is listening on

But a waste of time really for no benefit.
0
 
gheistCommented:
Nginx can replace varnish or apache or both.
0
 
badwolfffAuthor Commented:
Hi Gheist,

so you suggest I abandon varnish+apache2 solution totally and fall back on nginx+apache2 or just nginx for better results?

thanks
0
 
GaryCommented:
The above is rubbish
Varnish uses an in memory cache so will always be faster - assuming you are not restarting your server every day.
Nginx is faster than Apache so will always be better, though the config can be a bit apprehensive at first if you are used to Apache.

Varnish in front of nGinx makes the most sense

Varnish->Nginx->Apache - makes no sense, if set up correctly Varnish should be serving all your content, having nginx as a middle layer is just adding more complexity.
The nano seconds you gain by having nginx serve static content (where no cache exists) is lost by having to send everything else onto Apache to serve.
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now