Nginx as a reverse caching / load balancing solution - verification of setup needed

Good day Guys.

I would like to ask if someone could please verify my configs :

I have a Nginx server sitting in front of two Apache servers.
I’m using Nginx as a reverse caching / load balancing solution.
But what I’m trying achieve is to cache only for images, css and Js.

All in all it appears it all works.

The other question I would like to ask is, does the order of location
matter?

If anyone can help, it would be appreciated.

Thanks
Brent

2015-09-04 12:04 GMT+02:00 Brent C. [email protected]:

All in all it appears it all works.

The other question I would like to ask is, does the order of location
matter?

Depends. For regular expression based location is does, for prefix based
locations it doesn’t. See
http://nginx.org/en/docs/http/ngx_http_core_module.html#location

A location can either be defined by a prefix string, or by a regular

Thank you ever so much.

Regards
Brent

Igor recommends using prefix locations as much as possible.
If you were to use regex locations, you might want to embed them into
prefix ones so order only matters at the leaves of the tree, which helps
avoiding conflicts and makes you configuration scalable the most.

Here is a presentation by Igor himself about the latter:
Scaleable NGINX Configuration: Igor Sysoev @nginxconf 2014 - YouTube

B. R.

On Fri, Sep 4, 2015 at 2:01 PM, Brent C. [email protected]