<div dir="ltr">Здравствуйте!<div><br></div><div>У меня вопрос про mirror. Он у меня срабатывает, только если в локейшне есть proxy_pass. Если там rewrite..redirect или return, то подзапрос не случается, в логе совсем пусто (даже в debug логе). Так и должно быть? Если да, то может быть имеет смысл что-то в лог писать, а то нелогично как-то получается, директива в конфиге есть, а действия никакого нет.</div><div><br></div><div>Версию nginx и конфиг прикладываю ниже.</div><div><br></div><div>С уважением,<br>Александр</div><div><br></div><div>





<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:14px;line-height:normal;font-family:"Courier New";color:rgb(194,194,194);background-color:rgba(0,0,0,0.95)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">nginx version: nginx/1.15.4</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:14px;line-height:normal;font-family:"Courier New";color:rgb(194,194,194);background-color:rgba(0,0,0,0.95)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">configure arguments: --prefix=/opt/local --with-cc-opt='-I/opt/local/include -Os' --with-ld-opt='-L/opt/local/lib -Wl,-headerpad_max_install_names' --conf-path=/opt/local/etc/nginx/nginx.conf --error-log-path=/opt/local/var/log/nginx/error.log --http-log-path=/opt/local/var/log/nginx/access.log --pid-path=/opt/local/var/run/nginx/nginx.pid --lock-path=/opt/local/var/run/nginx/nginx.lock --http-client-body-temp-path=/opt/local/var/run/nginx/client_body_temp --http-proxy-temp-path=/opt/local/var/run/nginx/proxy_temp --http-fastcgi-temp-path=/opt/local/var/run/nginx/fastcgi_temp --http-uwsgi-temp-path=/opt/local/var/run/nginx/uwsgi_temp --with-debug --with-http_mp4_module --with-stream</span></p></div><div><br></div><div>





<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:14px;line-height:normal;font-family:"Courier New";color:rgb(194,194,194);background-color:rgba(0,0,0,0.95)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">http {</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:14px;line-height:normal;font-family:"Courier New";color:rgb(194,194,194);background-color:rgba(0,0,0,0.95)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">  </span>include <span class="gmail-Apple-converted-space">      </span>mime.types;</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:14px;line-height:normal;font-family:"Courier New";color:rgb(194,194,194);background-color:rgba(0,0,0,0.95)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">  </span>default_type<span class="gmail-Apple-converted-space">  </span>application/octet-stream;</span></p>
<p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:14px;line-height:normal;font-family:"Courier New";color:rgb(194,194,194);background-color:rgba(0,0,0,0.95);min-height:16px"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"></span><br></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:14px;line-height:normal;font-family:"Courier New";color:rgb(194,194,194);background-color:rgba(0,0,0,0.95)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">  </span>log_format stat '[$time_local] $server_port $status "$request" "$uri"';</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:14px;line-height:normal;font-family:"Courier New";color:rgb(194,194,194);background-color:rgba(0,0,0,0.95)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">  </span>log_subrequest on;</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:14px;line-height:normal;font-family:"Courier New";color:rgb(194,194,194);background-color:rgba(0,0,0,0.95)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">  </span>access_log /dev/stdout stat;</span></p>
<p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:14px;line-height:normal;font-family:"Courier New";color:rgb(194,194,194);background-color:rgba(0,0,0,0.95);min-height:16px"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"></span><br></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:14px;line-height:normal;font-family:"Courier New";color:rgb(194,194,194);background-color:rgba(0,0,0,0.95)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">  </span>server {</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:14px;line-height:normal;font-family:"Courier New";color:rgb(194,194,194);background-color:rgba(0,0,0,0.95)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">    </span>listen 8000 default_server;</span></p>
<p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:14px;line-height:normal;font-family:"Courier New";color:rgb(194,194,194);background-color:rgba(0,0,0,0.95);min-height:16px"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"></span><br></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:14px;line-height:normal;font-family:"Courier New";color:rgb(194,194,194);background-color:rgba(0,0,0,0.95)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">    </span>location /r {</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:14px;line-height:normal;font-family:"Courier New";color:rgb(194,194,194);background-color:rgba(0,0,0,0.95)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">      </span>mirror /stats;</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:14px;line-height:normal;font-family:"Courier New";color:rgb(194,194,194);background-color:rgba(0,0,0,0.95)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">      </span>return 200 "OK";</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:14px;line-height:normal;font-family:"Courier New";color:rgb(194,194,194);background-color:rgba(0,0,0,0.95)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">    </span>}</span></p>
<p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:14px;line-height:normal;font-family:"Courier New";color:rgb(194,194,194);background-color:rgba(0,0,0,0.95);min-height:16px"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"></span><br></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:14px;line-height:normal;font-family:"Courier New";color:rgb(194,194,194);background-color:rgba(0,0,0,0.95)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">    </span>location = /stats {</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:14px;line-height:normal;font-family:"Courier New";color:rgb(194,194,194);background-color:rgba(0,0,0,0.95)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">      </span>proxy_pass http://127.0.0.1:8001$uri;</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:14px;line-height:normal;font-family:"Courier New";color:rgb(194,194,194);background-color:rgba(0,0,0,0.95)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">    </span>}</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:14px;line-height:normal;font-family:"Courier New";color:rgb(194,194,194);background-color:rgba(0,0,0,0.95)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">  </span>}</span></p><p class="gmail-p1" style="margin:0px;font:14px "Courier New";color:rgb(194,194,194);background-color:rgba(0,0,0,0.95);min-height:16px"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"></span><br></p><p class="gmail-p2" style="margin:0px;font:14px "Courier New";color:rgb(194,194,194);background-color:rgba(0,0,0,0.95)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">  </span>server {</span></p><p class="gmail-p2" style="margin:0px;font:14px "Courier New";color:rgb(194,194,194);background-color:rgba(0,0,0,0.95)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">    </span>listen 8001 default_server;</span></p><p class="gmail-p1" style="margin:0px;font:14px "Courier New";color:rgb(194,194,194);background-color:rgba(0,0,0,0.95);min-height:16px"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"></span><br></p><p class="gmail-p2" style="margin:0px;font:14px "Courier New";color:rgb(194,194,194);background-color:rgba(0,0,0,0.95)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">    </span>location /o {</span></p><p class="gmail-p2" style="margin:0px;font:14px "Courier New";color:rgb(194,194,194);background-color:rgba(0,0,0,0.95)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">      </span>return 200 "OK";</span></p><p class="gmail-p2" style="margin:0px;font:14px "Courier New";color:rgb(194,194,194);background-color:rgba(0,0,0,0.95)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">    </span>}</span></p><p class="gmail-p1" style="margin:0px;font:14px "Courier New";color:rgb(194,194,194);background-color:rgba(0,0,0,0.95);min-height:16px"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"></span><br></p><p class="gmail-p2" style="margin:0px;font:14px "Courier New";color:rgb(194,194,194);background-color:rgba(0,0,0,0.95)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">    </span>location /stats {</span></p><p class="gmail-p2" style="margin:0px;font:14px "Courier New";color:rgb(194,194,194);background-color:rgba(0,0,0,0.95)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">      </span>return 204;</span></p><p class="gmail-p2" style="margin:0px;font:14px "Courier New";color:rgb(194,194,194);background-color:rgba(0,0,0,0.95)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">    </span>}</span></p><p class="gmail-p2" style="margin:0px;font:14px "Courier New";color:rgb(194,194,194);background-color:rgba(0,0,0,0.95)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">  </span>}</span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:14px;line-height:normal;font-family:"Courier New";color:rgb(194,194,194);background-color:rgba(0,0,0,0.95)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">

















</span></p><p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:14px;line-height:normal;font-family:"Courier New";color:rgb(194,194,194);background-color:rgba(0,0,0,0.95)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">}</span></p></div></div>