proxy_set_header Destination $proxy_destination;

Gena Makhomed gmm at csdoc.com
Thu Mar 5 14:49:27 MSK 2009


On Thursday, March 5, 2009 at 0:17:45, Igor Sysoev wrote:

IS> Probably to simplfy configuration even more I will make the "match" directive

IS>     match  $http_destination  ^https?(:.+)$;

IS>     proxy_set_header   Destination     http$1;

IS> as replacement to

IS>     set  $destination  $http_destination;

IS>     if ($http_destination ~* ^https(.+)$) {
IS>         set  $destination  $http$1;
IS>     }

IS>     proxy_set_header   Destination     $destination;

Игорь, а можно сделать так, что nginx будет сам менять
URI scheme в Destination на ту, что стоит в proxy_pass ?

или хотя бы сделать встроенную переменную $proxy_destination, которая будет иметь
ту же схему, что и proxy_pass, а все остальное как в оригинальном $http_destination

в результате - для 99.99999% случаев для корректного проксирования
WebDAV/SVN в конфиге nginx надо будет добавить только одну строчку:

    proxy_set_header Destination $proxy_destination;

если вопрос в том, чтобы не вычислять $proxy_destination
для каждого запроса - ее можно сделать как magic variable,
значение которой будет вычисляться в момент обращения к ней.

PS если мое предложение rejected - хотелось бы знать причину, в чем я ошибся.

-- 
Best regards,
 Gena






More information about the nginx-ru mailing list