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

B.R. reallfqq-nginx at yahoo.fr
Fri Sep 4 18:00:35 UTC 2015


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:
https://youtu.be/YWRYbLKsS0I
---
*B. R.*

On Fri, Sep 4, 2015 at 2:01 PM, Brent Clark <brentgclarklist at gmail.com>
wrote:

> Thank you ever so much.
>
> Regards
> Brent
>
>
> On 04/09/2015 13:29, Sebastian Krebs wrote:
>
>
>
> 2015-09-04 12:04 GMT+02:00 Brent Clark <brentgclarklist at gmail.com>:
>
>> Good day Guys.
>>
>> I would like to ask if someone could please verify my configs :
>> http://pastebin.com/8Xk63RYD
>> http://pastebin.com/EfNSpvMV
>>
>> 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?
>>
>
> 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>
> 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
>> expression. Regular expressions are specified with the preceding “~*”
>> modifier (for case-insensitive matching), or the “~” modifier (for
>> case-sensitive matching). *To find location matching a given request,
>> nginx first checks locations defined using the prefix strings (prefix
>> locations). Among them, the location with the longest matching prefix is
>> selected and remembered. Then regular expressions are checked, in the order
>> of their appearance in the configuration file. The search of regular
>> expressions terminates on the first match, and the corresponding
>> configuration is used. If no match with a regular expression is found then
>> the configuration of the prefix location remembered earlier is used.*
>>
>
>
>>
>> If anyone can help, it would be appreciated.
>>
>> Thanks
>> Brent
>>
>>
>>
>> _______________________________________________
>> nginx mailing list
>> nginx at nginx.org
>> http://mailman.nginx.org/mailman/listinfo/nginx
>>
>
>
>
> --
> github.com/KingCrunch
>
>
> _______________________________________________
> nginx mailing listnginx at nginx.orghttp://mailman.nginx.org/mailman/listinfo/nginx
>
>
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20150904/32622850/attachment.html>


More information about the nginx mailing list