Hi Ignor<br><br><div class="gmail_quote">On Fri, Dec 14, 2012 at 8:37 PM, Igor Sysoev <span dir="ltr"><<a href="mailto:igor@sysoev.ru" target="_blank">igor@sysoev.ru</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">
<br>
</div>This valid only if "~* /b" was intended for "~* ^/b".<br>
<br>
As to me, I prefer to isolate regex locations (if I have to use them at all)<br>
inside usual locations:<br>
<br>
location /c {<br>
location ~* \.(?:css|js|jpg|jpeg|gif|png)$ {<br>
expires 1y;<br>
}<br>
}<br>
<br></blockquote><div><br></div><div>My issue is in nginx, url can only be matched to only ONE location, unlike in Apache we have something like *<span style="background-color:rgb(244,244,244);color:rgb(17,0,0);font-size:12px;line-height:1.333"> ExpiresByType*, seems duplicate multiple locations is a must in nginx.</span></div>
<div><span style="background-color:rgb(244,244,244);color:rgb(17,0,0);font-size:12px;line-height:1.333"><br></span></div><div><span style="background-color:rgb(244,244,244);color:rgb(17,0,0);font-size:12px;line-height:1.333">e.g.</span></div>
<div><span style="background-color:rgb(244,244,244);color:rgb(17,0,0);font-size:12px;line-height:1.333"> </span></div><div><span style="background-color:rgb(244,244,244);color:rgb(17,0,0);font-size:12px;line-height:1.333"><br>
</span></div><div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">location ~* /a {</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
location ~* ^/.*\.(?:css|js|jpg|jpeg|gif|png)$ { </div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"> expires 1y;</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
}</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
# more unique config for /a, cannot be combined</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">}</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">location ~* /b {</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
location ~* ^/.*\.(?:css|js|jpg|jpeg|gif|png)$ { </div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"> expires 1y;</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
}</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
# more unique config for /b, cannot be combined</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">}</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">location ~* /c {</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
location ~* ^/.*\.(?:css|js|jpg|jpeg|gif|png)$ { </div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"> expires 1y;</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
}</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<div> # more unique config for /c, cannot be combined</div></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">}</div></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
Any better way?</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br></div></div>