<div dir="ltr">Здравствуйте,<div><br></div><div>У меня есть бекенд, который любит всегда возвращать Set-Cookie. Я от него получаю X-Accel-Redirect и хочу чтобы в ответе от Nginx не было Set-Cookie. У меня не получается этого добиться.</div>
<div><br></div><div>Версия Nginx:</div><div>
<p class="">$ nginx -V</p>
<p class="">nginx version: nginx/1.4.7</p>
<p class="">TLS SNI support enabled</p>
<p class="">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-ipv6 --with-http_gzip_static_module --with-http_image_filter_module --with-http_perl_module --with-perl=/opt/local/bin/perl --with-http_realip_module --with-http_secure_link_module --with-http_ssl_module --with-http_stub_status_module</p>
</div><div><br></div><div>Конфиг:</div><div><br></div><div>
<p class="">server {</p>
<p class=""> server_name _;</p>
<p class=""> listen *:80;</p>
<p class=""><br></p>
<p class=""> location /a {</p>
<p class=""> proxy_hide_header Set-Cookie;</p>
<p class=""> proxy_ignore_headers "Set-Cookie";</p>
<p class=""> proxy_pass <a href="http://r9:5000/api/5">http://r9:5000/api/5</a>;</p>
<p class=""> }</p>
<p class=""><br></p>
<p class=""> location /b {</p>
<p class=""> proxy_hide_header Set-Cookie;</p>
<p class=""> proxy_ignore_headers "Set-Cookie" "X-Accel-Redirect";</p>
<p class=""> proxy_pass <a href="http://r9:5000/api/5">http://r9:5000/api/5</a>;</p>
<p class=""> }</p>
<p class=""><br></p>
<p class=""> location /_x {</p>
<p class=""> add_header X-Uri $uri;</p>
<p class=""> return 204;</p>
<p class=""> }</p>
<p class="">}</p><p class="">Результаты:</p><p class="">$ curl -i <a href="http://127.0.0.1/a">http://127.0.0.1/a</a></p><p class="">HTTP/1.1 204 No Content</p><p class="">Server: nginx/1.4.7</p><p class="">Date: Wed, 30 Apr 2014 10:12:15 GMT</p>
<p class="">Connection: keep-alive</p><p class="">Set-Cookie: PLAY_SESSION="bcf94e2996bcb8885056bea401ffb0f53dd44577-csrfToken=55a3490742002528628151751e509e57316a92b8-1398852735621-c5dae9d9b61fddafa51a0ba3"; Path=/; HTTPOnly</p>
<p class="">X-Uri: /_x/5</p><p class=""><br></p><p class="">$ curl -i <a href="http://127.0.0.1/b">http://127.0.0.1/b</a></p><p class="">HTTP/1.1 204 No Content</p><p class="">Server: nginx/1.4.7</p><p class="">Date: Wed, 30 Apr 2014 10:12:17 GMT</p>
<p class="">Content-Length: 0</p><p class="">
</p><p class="">Connection: keep-alive</p><p class=""><br></p><p class="">Можно ли вырезать Set-Cookie от сервера, вернувшего X-Accel-Redirect?</p><p class="">С уважением,<br>Александр</p></div></div>