<div dir="ltr">То есть проблема в <span style="font-family:arial,sans-serif;font-size:18.095239639282227px;line-height:20.571430206298828px">edit на конце регулярного выражения?</span><div><font face="arial, sans-serif">Я понял, спасибо</font></div>
<div><font face="arial, sans-serif"><br></font></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-07-01 6:16 GMT+03:00 М.А. Мохначевский <span dir="ltr"><<a href="mailto:tetsio.nainn@gmail.com" target="_blank">tetsio.nainn@gmail.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div style="font-family:arial,sans-serif;font-size:13px"><div class=""><div>location ~ edit$ {</div><div>
return 444;</div><div> }</div><div><br></div></div><div>вот и </div></div><div class=""><div style="font-family:arial,sans-serif;font-size:13px">
2014/06/30 19:16:45 [debug] 39996#0: *3523 test location: ~ "edit$"</div><div style="font-family:arial,sans-serif;font-size:13px">2014/06/30 19:16:45 [debug] 39996#0: *3523 using configuration "edit$"</div>
<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div>
</div><div class="gmail_quote">01.07.2014 12:42 пользователь "Andrey Rogovsky" <<a href="mailto:a.rogovsky@gmail.com" target="_blank">a.rogovsky@gmail.com</a>> написал:<br type="attribution"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div><div class="h5">
<div dir="ltr"><div>Имею следующий конфиг nginx:</div><div><br></div><div>-- начало --</div><div><br></div><div>server {</div><div><span style="white-space:pre-wrap"> </span>listen 80;</div><div> <span style="white-space:pre-wrap"> </span>server_name <a href="http://mydomain.com" target="_blank">mydomain.com</a>;</div>
<div> <span style="white-space:pre-wrap"> </span>#access_log /var/log/nginx/mydomain.com.access.log main;</div><div> <span style="white-space:pre-wrap"> </span>access_log off;</div><div> <span style="white-space:pre-wrap"> </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 style="white-space:pre-wrap"> </span>location / {</div><div><span style="white-space:pre-wrap"> </span>limit_req zone=two burst=3 nodelay;</div><div> <span style="white-space:pre-wrap"> </span>proxy_pass <a href="http://backend" target="_blank">http://backend</a>;</div>
<div> <span style="white-space:pre-wrap"> </span>proxy_http_version 1.1;</div><div> <span style="white-space:pre-wrap"> </span>proxy_set_header Connection "";</div><div> <span style="white-space:pre-wrap"> </span>proxy_redirect off;</div>
<div> <span style="white-space:pre-wrap"> </span>#proxy_set_header Host $host;</div><div> <span style="white-space:pre-wrap"> </span>proxy_set_header Host '<a href="http://mydomain.com" target="_blank">mydomain.com</a>';</div>
<div> <span style="white-space:pre-wrap"> </span>proxy_set_header X-Real-IP $remote_addr;</div><div> <span style="white-space:pre-wrap"> </span>proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;</div>
<div> <span style="white-space:pre-wrap"> </span>proxy_set_header UA $uaix;</div><div> <span style="white-space:pre-wrap"> </span>proxy_set_header MSK $mskix;</div><div> <span style="white-space:pre-wrap"> </span>proxy_set_header GEOIP_COUNTRY_CODE $geoip_country_code;</div>
<div> <span style="white-space:pre-wrap"> </span>proxy_set_header GEOIP_COUNTRY_CODE3 $geoip_country_code3;</div><div> <span style="white-space:pre-wrap"> </span>proxy_set_header GEOIP_COUNTRY_NAME $geoip_country_name;</div>
<div> <span style="white-space:pre-wrap"> </span>proxy_connect_timeout 10;</div><div> <span style="white-space:pre-wrap"> </span>proxy_send_timeout 10;</div><div> <span style="white-space:pre-wrap"> </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 style="white-space:pre-wrap"> </span>}</div><div><span style="white-space:pre-wrap"> </span>if ($uri ~ "^/script_var/(.+\.js)$") {</div>
<div> <span style="white-space:pre-wrap"> </span>set $jsname $1;</div><div><span style="white-space:pre-wrap"> </span>}</div><div><span style="white-space:pre-wrap"> </span>location ~* /script_var/.+\.(js)$ {</div>
<div> <span style="white-space:pre-wrap"> </span>root /var/www/<a href="http://mydomain.com" target="_blank">mydomain.com</a>;</div><div> <span style="white-space:pre-wrap"> </span>try_files /adv/$geoip_country_code/$jsname /adv/$jsname = 404;</div>
<div><span style="white-space:pre-wrap"> </span>}</div><div> <span style="white-space:pre-wrap"> </span>location = /script.php {</div><div><span style="white-space:pre-wrap"> </span>return 444;</div><div> <span style="white-space:pre-wrap"> </span>}</div>
<div> location ~ edit$ {</div><div> return 444;</div><div> }</div><div> <span style="white-space:pre-wrap"> </span>location ~ playlist.php$ {</div><div> <span style="white-space:pre-wrap"> </span>proxy_pass <a href="http://backend" target="_blank">http://backend</a>;</div>
<div> <span style="white-space:pre-wrap"> </span>proxy_redirect off;</div><div> <span style="white-space:pre-wrap"> </span>proxy_http_version 1.1;</div><div> <span style="white-space:pre-wrap"> </span>proxy_set_header Connection "";</div>
<div> <span style="white-space:pre-wrap"> </span>proxy_set_header Host $host;</div><div> <span style="white-space:pre-wrap"> </span>proxy_set_header X-Real-IP $remote_addr;</div><div> <span style="white-space:pre-wrap"> </span>proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; </div>
<div> <span style="white-space:pre-wrap"> </span>proxy_set_header UA $uaix;</div><div> <span style="white-space:pre-wrap"> </span>proxy_set_header MSK $mskix;</div><div> <span style="white-space:pre-wrap"> </span>proxy_connect_timeout 60;</div>
<div> <span style="white-space:pre-wrap"> </span>proxy_send_timeout 60;</div><div> <span style="white-space:pre-wrap"> </span>proxy_read_timeout 60;</div><div> <span style="white-space:pre-wrap"> </span>}</div>
<div> <span style="white-space:pre-wrap"> </span>location ~ admin.php$ {</div><div> <span style="white-space:pre-wrap"> </span>allow 91.218.74.202;</div><div> <span style="white-space:pre-wrap"> </span>allow 213.186.118.138;</div>
<div> <span style="white-space:pre-wrap"> </span>allow 94.232.208.220;</div><div> <span style="white-space:pre-wrap"> </span>allow 176.9.35.227;</div><div> <span style="white-space:pre-wrap"> </span>allow 83.69.224.215;</div>
<div><span style="white-space:pre-wrap"> </span># deny all;</div><div> <span style="white-space:pre-wrap"> </span>proxy_pass <a href="http://backend" target="_blank">http://backend</a>;</div><div> <span style="white-space:pre-wrap"> </span>proxy_redirect off;</div>
<div> <span style="white-space:pre-wrap"> </span>proxy_http_version 1.1;</div><div> <span style="white-space:pre-wrap"> </span>proxy_set_header Connection "";</div><div> <span style="white-space:pre-wrap"> </span>proxy_set_header Host $host;</div>
<div> <span style="white-space:pre-wrap"> </span>proxy_set_header X-Real-IP $remote_addr;</div><div> <span style="white-space:pre-wrap"> </span>proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;</div>
<div><span style="white-space:pre-wrap"> </span>proxy_set_header UA $uaix;</div><div> <span style="white-space:pre-wrap"> </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 style="white-space:pre-wrap"> </span>proxy_connect_timeout 60;</div>
<div> <span style="white-space:pre-wrap"> </span>proxy_send_timeout 60;</div><div> <span style="white-space:pre-wrap"> </span>proxy_read_timeout 60;</div><div> <span style="white-space:pre-wrap"> </span>}</div>
<div> <span style="white-space:pre-wrap"> </span>location ~ ^/cgi-bin/.*\.cgi$ {</div><div> <span style="white-space:pre-wrap"> </span>proxy_pass <a href="http://backend" target="_blank">http://backend</a>;</div><div>
<span style="white-space:pre-wrap"> </span>proxy_redirect off;</div>
<div> <span style="white-space:pre-wrap"> </span>}</div><div> <span style="white-space:pre-wrap"> </span>location ~ ^/adv/.*$ {</div><div> <span style="white-space:pre-wrap"> </span>deny all;</div><div>
<span style="white-space:pre-wrap"> </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 style="white-space:pre-wrap"> </span># Static files location</div><div> <span style="white-space:pre-wrap"> </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 style="white-space:pre-wrap"> </span>valid_referers none blocked *.<a href="http://mydomain.com" target="_blank">mydomain.com</a> <a href="http://mydomain.com" target="_blank">mydomain.com</a>;</div><div>
if ($invalid_referer) {</div>
<div> return 403;</div><div> }</div><div> <span style="white-space:pre-wrap"> </span>root /var/www/<a href="http://mydomain.com" target="_blank">mydomain.com</a>;</div><div>
<span style="white-space:pre-wrap"> </span>expires 10080m;</div>
<div> <span style="white-space:pre-wrap"> </span>}</div><div> <span style="white-space:pre-wrap"> </span>location /nginx_status {</div><div> <span style="white-space:pre-wrap"> </span>stub_status on;</div>
<div> <span style="white-space:pre-wrap"> </span>access_log off;</div><div> <span style="white-space:pre-wrap"> </span>allow 91.218.74.202;</div><div> <span style="white-space:pre-wrap"> </span>allow 213.186.118.138;</div>
<div> <span style="white-space:pre-wrap"> </span>allow 94.232.208.220;</div><div> <span style="white-space:pre-wrap"> </span>allow 212.113.52.4;</div><div> <span style="white-space:pre-wrap"> </span>deny all;</div>
<div> <span style="white-space:pre-wrap"> </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 style="white-space:pre-wrap"> </span>proxy_http_version 1.1;</div>
<div> <span style="white-space:pre-wrap"> </span>proxy_set_header Connection "";</div><div> <span style="white-space:pre-wrap"> </span>proxy_redirect off;</div><div> <span style="white-space:pre-wrap"> </span>#proxy_set_header Host $host;</div>
<div> <span style="white-space:pre-wrap"> </span>proxy_set_header Host '<a href="http://mydomain.com" target="_blank">mydomain.com</a>';</div><div> <span style="white-space:pre-wrap"> </span>proxy_set_header X-Real-IP $remote_addr;</div>
<div> <span style="white-space:pre-wrap"> </span>proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;</div><div> <span style="white-space:pre-wrap"> </span>proxy_set_header UA $uaix;</div><div>
<span style="white-space:pre-wrap"> </span>proxy_set_header MSK $mskix;</div><div> <span style="white-space:pre-wrap"> </span>proxy_set_header GEOIP_COUNTRY_CODE $geoip_country_code;</div><div> <span style="white-space:pre-wrap"> </span>proxy_set_header GEOIP_COUNTRY_CODE3 $geoip_country_code3;</div>
<div> <span style="white-space:pre-wrap"> </span>proxy_set_header GEOIP_COUNTRY_NAME $geoip_country_name;</div><div> <span style="white-space:pre-wrap"> </span>proxy_connect_timeout 10;</div><div> <span style="white-space:pre-wrap"> </span>proxy_send_timeout 10;</div>
<div> <span style="white-space:pre-wrap"> </span>proxy_read_timeout 10;</div><div><span style="white-space:pre-wrap"> </span>proxy_pass <a href="http://backend" target="_blank">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" target="_blank">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" target="_blank">mydomain.com</a>, request: "GET /actors/Bezrukov HTTP</div>
<div>/1.1", host: "<a href="http://mydomain.com" target="_blank">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" target="_blank">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" target="_blank">mydomain.com</a>, request: "GET /actors/Bargess-Meredit HTTP/1.1", host: "<a href="http://mydomain.com" target="_blank">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>
<br></div></div>_______________________________________________<br>
nginx-ru mailing list<br>
<a href="mailto:nginx-ru@nginx.org" target="_blank">nginx-ru@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx-ru" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx-ru</a><br></blockquote></div>
</div>
<br>_______________________________________________<br>
nginx-ru mailing list<br>
<a href="mailto:nginx-ru@nginx.org">nginx-ru@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx-ru" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx-ru</a><br></blockquote></div><br></div>