<div dir="ltr"><div>Имею следующий конфиг nginx:</div><div><br></div><div>-- начало --</div><div><br></div><div>server {</div><div><span class="" style="white-space:pre">     </span>listen  80;</div><div>  <span class="" style="white-space:pre">    </span>server_name  <a href="http://mydomain.com">mydomain.com</a>;</div>
<div>  <span class="" style="white-space:pre"> </span>#access_log  /var/log/nginx/mydomain.com.access.log  main;</div><div>  <span class="" style="white-space:pre">    </span>access_log off;</div><div>  <span class="" style="white-space:pre"> </span>error_log   /var/log/nginx/mydomain.com.error.log crit;</div>
<div>        open_file_cache max=10000 inactive=120s;</div><div>        open_file_cache_valid 30s;</div><div>        open_file_cache_min_uses 2;</div><div>        open_file_cache_errors off;</div><div><br></div><div>error_page 558 = @post;</div>
<div><br></div><div>  <span class="" style="white-space:pre">        </span>location / {</div><div><span class="" style="white-space:pre">               </span>limit_req   zone=two  burst=3 nodelay;</div><div>      <span class="" style="white-space:pre">          </span>proxy_pass <a href="http://backend">http://backend</a>;</div>
<div>      <span class="" style="white-space:pre">           </span>proxy_http_version 1.1;</div><div>      <span class="" style="white-space:pre">           </span>proxy_set_header Connection "";</div><div>      <span class="" style="white-space:pre">         </span>proxy_redirect off;</div>
<div>      <span class="" style="white-space:pre">           </span>#proxy_set_header Host $host;</div><div>      <span class="" style="white-space:pre">             </span>proxy_set_header Host '<a href="http://mydomain.com">mydomain.com</a>';</div>
<div>      <span class="" style="white-space:pre">           </span>proxy_set_header X-Real-IP $remote_addr;</div><div>      <span class="" style="white-space:pre">          </span>proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;</div>
<div>      <span class="" style="white-space:pre">           </span>proxy_set_header UA $uaix;</div><div>            <span class="" style="white-space:pre">       </span>proxy_set_header MSK $mskix;</div><div>      <span class="" style="white-space:pre">              </span>proxy_set_header GEOIP_COUNTRY_CODE $geoip_country_code;</div>
<div>      <span class="" style="white-space:pre">           </span>proxy_set_header GEOIP_COUNTRY_CODE3 $geoip_country_code3;</div><div>      <span class="" style="white-space:pre">                </span>proxy_set_header GEOIP_COUNTRY_NAME $geoip_country_name;</div>
<div>      <span class="" style="white-space:pre">           </span>proxy_connect_timeout 10;</div><div>      <span class="" style="white-space:pre">         </span>proxy_send_timeout 10;</div><div>      <span class="" style="white-space:pre">            </span>proxy_read_timeout 10;</div>
<div><br></div><div>    if ($request_method = POST) {</div><div>    return 558;</div><div>    }</div><div><br></div><div>  <span class="" style="white-space:pre">       </span>}</div><div><span class="" style="white-space:pre">  </span>if ($uri ~ "^/script_var/(.+\.js)$") {</div>
<div>      <span class="" style="white-space:pre">           </span>set $jsname $1;</div><div><span class="" style="white-space:pre">    </span>}</div><div><span class="" style="white-space:pre">  </span>location  ~* /script_var/.+\.(js)$ {</div>
<div>  <span class="" style="white-space:pre">         </span>root /var/www/<a href="http://mydomain.com">mydomain.com</a>;</div><div>  <span class="" style="white-space:pre">             </span>try_files /adv/$geoip_country_code/$jsname  /adv/$jsname  = 404;</div>
<div><span class="" style="white-space:pre">    </span>}</div><div>  <span class="" style="white-space:pre">       </span>location = /script.php {</div><div><span class="" style="white-space:pre">           </span>return 444;</div><div>  <span class="" style="white-space:pre">     </span>}</div>
<div>        location ~ edit$ {</div><div>                return 444;</div><div>        }</div><div>  <span class="" style="white-space:pre">      </span>location ~ playlist.php$ {</div><div>      <span class="" style="white-space:pre">                </span>proxy_pass <a href="http://backend">http://backend</a>;</div>
<div>      <span class="" style="white-space:pre">           </span>proxy_redirect off;</div><div>      <span class="" style="white-space:pre">               </span>proxy_http_version 1.1;</div><div>      <span class="" style="white-space:pre">           </span>proxy_set_header Connection "";</div>
<div>      <span class="" style="white-space:pre">           </span>proxy_set_header Host $host;</div><div>      <span class="" style="white-space:pre">              </span>proxy_set_header X-Real-IP $remote_addr;</div><div>      <span class="" style="white-space:pre">          </span>proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; </div>
<div>      <span class="" style="white-space:pre">           </span>proxy_set_header UA $uaix;</div><div>            <span class="" style="white-space:pre">       </span>proxy_set_header MSK $mskix;</div><div>      <span class="" style="white-space:pre">              </span>proxy_connect_timeout 60;</div>
<div>      <span class="" style="white-space:pre">           </span>proxy_send_timeout 60;</div><div>      <span class="" style="white-space:pre">            </span>proxy_read_timeout 60;</div><div>  <span class="" style="white-space:pre">  </span>}</div>
<div>  <span class="" style="white-space:pre"> </span>location ~ admin.php$ {</div><div>      <span class="" style="white-space:pre">           </span>allow 91.218.74.202;</div><div>      <span class="" style="white-space:pre">              </span>allow 213.186.118.138;</div>
<div>      <span class="" style="white-space:pre">           </span>allow 94.232.208.220;</div><div>      <span class="" style="white-space:pre">             </span>allow 176.9.35.227;</div><div>      <span class="" style="white-space:pre">               </span>allow 83.69.224.215;</div>
<div><span class="" style="white-space:pre">            </span>#      deny all;</div><div>      <span class="" style="white-space:pre">               </span>proxy_pass <a href="http://backend">http://backend</a>;</div><div>      <span class="" style="white-space:pre">             </span>proxy_redirect off;</div>
<div>      <span class="" style="white-space:pre">           </span>proxy_http_version 1.1;</div><div>      <span class="" style="white-space:pre">           </span>proxy_set_header Connection "";</div><div>      <span class="" style="white-space:pre">         </span>proxy_set_header Host $host;</div>
<div>      <span class="" style="white-space:pre">           </span>proxy_set_header X-Real-IP $remote_addr;</div><div>      <span class="" style="white-space:pre">          </span>proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;</div>
<div><span class="" style="white-space:pre">            </span>proxy_set_header UA $uaix;</div><div>            <span class="" style="white-space:pre">       </span>proxy_set_header MSK $mskix;</div><div>                proxy_set_header GEOIP_COUNTRY_CODE $geoip_country_code;</div>
<div>                proxy_set_header GEOIP_COUNTRY_CODE3 $geoip_country_code3;</div><div>                proxy_set_header GEOIP_COUNTRY_NAME $geoip_country_name;</div><div>      <span class="" style="white-space:pre">           </span>proxy_connect_timeout 60;</div>
<div>      <span class="" style="white-space:pre">           </span>proxy_send_timeout 60;</div><div>      <span class="" style="white-space:pre">            </span>proxy_read_timeout 60;</div><div>  <span class="" style="white-space:pre">  </span>}</div>
<div>  <span class="" style="white-space:pre"> </span>location ~ ^/cgi-bin/.*\.cgi$ {</div><div>      <span class="" style="white-space:pre">           </span>proxy_pass <a href="http://backend">http://backend</a>;</div><div>      <span class="" style="white-space:pre">             </span>proxy_redirect off;</div>
<div>  <span class="" style="white-space:pre"> </span>}</div><div>  <span class="" style="white-space:pre">       </span>location ~ ^/adv/.*$ {</div><div>      <span class="" style="white-space:pre">            </span>deny all;</div><div>
  <span class="" style="white-space:pre">    </span>}</div><div>        location ~ ^/msqlmdmf/(.+\.(?:gif|jpe?g|png|ico|css|zip|tgz|gz|rar|bz2|tar|js))$ {</div><div>                alias /usr/share/phpmyadmin/$1;</div><div>        }</div>
<div>  <span class="" style="white-space:pre"> </span># Static files location</div><div>  <span class="" style="white-space:pre"> </span>location ~* ^.+\.(swf|ver|ver|jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|tar|wav|bmp|rtf|js)$ {</div>
<div>      <span class="" style="white-space:pre">           </span>valid_referers none blocked *.<a href="http://mydomain.com">mydomain.com</a> <a href="http://mydomain.com">mydomain.com</a>;</div><div>                if ($invalid_referer) {</div>
<div>                       return   403;</div><div>                }</div><div>      <span class="" style="white-space:pre">           </span>root   /var/www/<a href="http://mydomain.com">mydomain.com</a>;</div><div>      <span class="" style="white-space:pre">            </span>expires 10080m;</div>
<div>  <span class="" style="white-space:pre"> </span>}</div><div>  <span class="" style="white-space:pre">       </span>location /nginx_status {</div><div>      <span class="" style="white-space:pre">          </span>stub_status on;</div>
<div>      <span class="" style="white-space:pre">           </span>access_log   off;</div><div>      <span class="" style="white-space:pre">                </span>allow 91.218.74.202;</div><div>      <span class="" style="white-space:pre">              </span>allow 213.186.118.138;</div>
<div>      <span class="" style="white-space:pre">           </span>allow 94.232.208.220;</div><div>      <span class="" style="white-space:pre">             </span>allow 212.113.52.4;</div><div>      <span class="" style="white-space:pre">               </span>deny all;</div>
<div>  <span class="" style="white-space:pre"> </span>}</div><div><br></div><div><br></div><div>location @post</div><div>{</div><div>limit_req   zone=two  burst=1;</div><div>set $limit_rate  128k;</div><div>      <span class="" style="white-space:pre">             </span>proxy_http_version 1.1;</div>
<div>      <span class="" style="white-space:pre">           </span>proxy_set_header Connection "";</div><div>      <span class="" style="white-space:pre">         </span>proxy_redirect off;</div><div>      <span class="" style="white-space:pre">               </span>#proxy_set_header Host $host;</div>
<div>      <span class="" style="white-space:pre">           </span>proxy_set_header Host '<a href="http://mydomain.com">mydomain.com</a>';</div><div>      <span class="" style="white-space:pre">             </span>proxy_set_header X-Real-IP $remote_addr;</div>
<div>      <span class="" style="white-space:pre">           </span>proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;</div><div>      <span class="" style="white-space:pre">              </span>proxy_set_header UA $uaix;</div><div>
            <span class="" style="white-space:pre">     </span>proxy_set_header MSK $mskix;</div><div>      <span class="" style="white-space:pre">              </span>proxy_set_header GEOIP_COUNTRY_CODE $geoip_country_code;</div><div>      <span class="" style="white-space:pre">          </span>proxy_set_header GEOIP_COUNTRY_CODE3 $geoip_country_code3;</div>
<div>      <span class="" style="white-space:pre">           </span>proxy_set_header GEOIP_COUNTRY_NAME $geoip_country_name;</div><div>      <span class="" style="white-space:pre">          </span>proxy_connect_timeout 10;</div><div>      <span class="" style="white-space:pre">         </span>proxy_send_timeout 10;</div>
<div>      <span class="" style="white-space:pre">           </span>proxy_read_timeout 10;</div><div><span class="" style="white-space:pre">     </span>proxy_pass <a href="http://backend">http://backend</a>;</div><div>#return 444;</div>
<div>} </div><div><br></div><div>}</div><div><br></div><div>-- конец --</div><div><br></div><div>В общем все довольно стандартно.</div><div><br></div><div><br></div><div>При этом запрос к сайту вида <a href="http://mydomain.com/actors/Bezrukov">http://mydomain.com/actors/Bezrukov</a> обрабатывается нормально:</div>
<div><br></div><div>2014/06/30 19:16:24 [debug] 39999#0: *3009 http script var: "/actors/Bezrukov"</div><div>2014/06/30 19:16:24 [debug] 39999#0: *3009 http script regex: "^/script_var/(.+\.js)$"</div>
<div>2014/06/30 19:16:24 [notice] 39999#0: *3009 "^/script_var/(.+\.js)$" does not match "/actors/Bezrukov", client: 188.130.179.10, server: <a href="http://mydomain.com">mydomain.com</a>, request: "GET /actors/Bezrukov HTTP</div>
<div>/1.1", host: "<a href="http://mydomain.com">mydomain.com</a>"</div><div>2014/06/30 19:16:24 [debug] 39999#0: *3009 http script if</div><div>2014/06/30 19:16:24 [debug] 39999#0: *3009 http script if: false</div>
<div>2014/06/30 19:16:24 [debug] 39999#0: *3009 test location: "/"</div><div>2014/06/30 19:16:24 [debug] 39999#0: *3009 test location: "script.php"</div><div>2014/06/30 19:16:24 [debug] 39999#0: *3009 test location: "nginx_status"</div>
<div>2014/06/30 19:16:24 [debug] 39999#0: *3009 test location: ~ "/script_var/.+\.(js)$"</div><div>2014/06/30 19:16:24 [debug] 39999#0: *3009 test location: ~ "edit$"</div><div>2014/06/30 19:16:24 [debug] 39999#0: *3009 test location: ~ "playlist.php$"</div>
<div>2014/06/30 19:16:24 [debug] 39999#0: *3009 test location: ~ "admin.php$"</div><div>2014/06/30 19:16:24 [debug] 39999#0: *3009 test location: ~ "^/cgi-bin/.*\.cgi$"</div><div>2014/06/30 19:16:24 [debug] 39999#0: *3009 test location: ~ "^/adv/.*$"</div>
<div>2014/06/30 19:16:24 [debug] 39999#0: *3009 test location: ~ "^/msqlmdmf/(.+\.(?:gif|jpe?g|png|ico|css|zip|tgz|gz|rar|bz2|tar|js))$"</div><div>2014/06/30 19:16:24 [debug] 39999#0: *3009 test location: ~ "^.+\.(swf|ver|ver|jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|tar|wav|bmp|rtf|js)$"</div>
<div>2014/06/30 19:16:24 [debug] 39999#0: *3009 using configuration "/"</div><div><br></div><div>А вот с запросом вида <a href="http://mydomain.com/actors/Bargess-Meredit">http://mydomain.com/actors/Bargess-Meredit</a> происходит вот такой глюк:</div>
<div><br></div><div>2014/06/30 19:16:45 [debug] 39996#0: *3523 http script var: "/actors/Bargess-Meredit"</div><div>2014/06/30 19:16:45 [debug] 39996#0: *3523 http script regex: "^/script_var/(.+\.js)$"</div>
<div>2014/06/30 19:16:45 [notice] 39996#0: *3523 "^/script_var/(.+\.js)$" does not match "/actors/Bargess-Meredit", client: 188.130.179.10, server: <a href="http://mydomain.com">mydomain.com</a>, request: "GET /actors/Bargess-Meredit HTTP/1.1", host: "<a href="http://mydomain.com">mydomain.com</a>"</div>
<div>2014/06/30 19:16:45 [debug] 39996#0: *3523 http script if</div><div>2014/06/30 19:16:45 [debug] 39996#0: *3523 http script if: false</div><div>2014/06/30 19:16:45 [debug] 39996#0: *3523 test location: "/"</div>
<div>2014/06/30 19:16:45 [debug] 39996#0: *3523 test location: "script.php"</div><div>2014/06/30 19:16:45 [debug] 39996#0: *3523 test location: "nginx_status"</div><div>2014/06/30 19:16:45 [debug] 39996#0: *3523 test location: ~ "/script_var/.+\.(js)$"</div>
<div>2014/06/30 19:16:45 [debug] 39996#0: *3523 test location: ~ "edit$"</div><div>2014/06/30 19:16:45 [debug] 39996#0: *3523 using configuration "edit$"</div><div><br></div><div><br></div><div>Почему /actors/Bargess-Meredit не обрабатывается корневым локейшеном?</div>
<div><br></div><div>Причем я пробовал разные версии nginx - глюк повторяется что на текущем, что на свежескаченном с официального сайта. ОС Debian 6.</div><div><br></div></div>