Skip to main content
Participant
June 8, 2012
Question

NginX as Web server for CF10

  • June 8, 2012
  • 1 reply
  • 4534 views

Hi everyone,

I've been playing around with CF10 with our server and it works great. It's just I've been wondering if it is possible to use Nginx as the web server? maybe someone can guide me through on how to make it work on a CentOS 5 server.

Thank you in advance.

Andrew

This topic has been closed for replies.

1 reply

Participating Frequently
June 8, 2012
Participant
June 8, 2012

Hi Padz,

Thank you for responding to my query. I've checked on the links that you gave and it's really helpful. Just one thing on the discussion for url rewriting, I think it still uses the internal web server "Apache Tomcat". Is there a possibility that this internal web server totally replaced with Nginx? Just like the option to use Apache web server upon installation of CF10.

Thanks again.

Andrew

Participating Frequently
June 8, 2012

Hi Andrew,

In a word, no.  The reason being is that CF is a java web app so needs to live within a java app server.  When you look at the deployment variations for CF you'll see that CF always lives within a java app server engine such as Tomcat, JRun, JBoss, Oracle As, Websphere .. java app server whatever. 

By configuring an external web server such as Apache or IIS or JWS or Nginx you are proxying the web traffic through the web server to service the requests.  So why bother using a web server?  Well, two quick, very good reasons include:

  1. Separation of static and dynamic content loads [web server belts out the static stuff [js, css, html, txt]as fast as poss and the java app only needs to focus on the bits that concern it [cfoutput or similar]].
  2. Web servers offer a range of additional functions to improve overall system performance such as multi-hosting [virtual hosts], forward caching for content, dynamic file compression, additional security functionality, forward errror handling, etc thereby reducing unecessary load to the java app server.

Why Nginx over Apache?  It's about resource utilisation on the hardware.  Nginx has a much lower footprint than Apache (around 15mb vs 53mb per instance so handles more traffic).  Nginx is reputed to process requests faster than apache as well. Nginx been around for 7+ years now so is pretty mature and stable.  Nginx has also been used successfuly for software based load balancing in front of large website clusters. 

Does that help answer the question?

Padz