<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif">Столкнулся с проблемой необходимости перевести apache на nginx. На данный момент в apache в настройках виртуалхоста есть директивы<br><br>ProxyPassReverse / <a href="http://javaclr.example.net/">http://javaclr.example.net/</a><br>ProxyPassReverse / <a href="http://imagesclr.example.net/">http://imagesclr.example.net/</a><br>ProxyPassReverse / <a href="http://aspclr.example.net/">http://aspclr.example.net/</a><br>ProxyPassReverse / <a href="http://vsclr.example.net/">http://vsclr.example.net/</a><br><br></div><div class="gmail_default" style="font-family:verdana,sans-serif">В офф документации nginx - <a href="https://www.nginx.com/resources/wiki/start/topics/examples/likeapache/">https://www.nginx.com/resources/wiki/start/topics/examples/likeapache/</a> говорится, что достаточно использовать proxy_pass и передавать соотв хедеры.<br><br></div><div class="gmail_default" style="font-family:verdana,sans-serif">Но тут возникает вопрос, а как мне в одном location использовать несколько директив proxy_pass. Или единственный выход использовать map, что то вида<br><br>map $host $proxy_host {<br>    default "";<br>  "~(javaclr|imagesclr|aspclr|vsclr)\.example\.net" "$host";<br>}<br><br>server {<br>    listen 80;<br>    server_name  <a href="http://javaclr.example.net">javaclr.example.net</a> <a href="http://imagesclr.example.net">imagesclr.example.net</a> <a href="http://aspclr.example.net">aspclr.example.net</a> <a href="http://vsclr.example.net">vsclr.example.net</a>;<br><br>   location / {<br>      proxy_pass http://$proxy_host;<br>      proxy_set_header X-Forwarded-Host $host;<br>      proxy_set_header X-Forwarded-Server $host;<br>      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;<br>   }<br>}<br><br></div></div>