<div dir="ltr"><div><div><div><div><div><div>Hi All.<br><br></div>When I setup the following, the authentication+proxying works perfect, with the url changing from <a href="http://1.2.3.4:2001">http://1.2.3.4:2001</a> to <a href="http://1.2.3.4:2001/cgi-bin/webproc">http://1.2.3.4:2001/cgi-bin/webproc</a>, and the proxied0server opening up perfectly.<br><br>############################################################################<br>server {<br>        listen 2001;<br>        location / {<br><br>                        auth_basic 'Restricted';<br>                        auth_basic_user_file /home/2819163155b64c4c81f8608aa23c9faa/.htpasswd;<br>                        proxy_pass <a href="http://127.0.0.1:2000">http://127.0.0.1:2000</a>;<br>                }<br>        }<br>#############################################################################<br><br><br><br></div>However, I am not able to do the proxying if I perform url-rewriting.<br></div>Nothing of the following works ::<br><br></div>a)<br>############################################################################<br>server {<br>        listen 2001;<br>        location /78 {<br><br>                        auth_basic 'Restricted';<br>                        auth_basic_user_file /home/2819163155b64c4c81f8608aa23c9faa/.htpasswd;<br>                        proxy_pass <a href="http://127.0.0.1:2000">http://127.0.0.1:2000</a>;<br>                }<br>        }<br>############################################################################<br><br></div>No URL change happens, and 404 (illegal-file-access) is obtained.<br><br><br></div>b)<br>############################################################################<br>server {<br>        listen 2001;<br>        location /78 {<br><br>                        auth_basic 'Restricted';<br>                        auth_basic_user_file /home/2819163155b64c4c81f8608aa23c9faa/.htpasswd;<br>                        proxy_pass <a href="http://127.0.0.1:2000/">http://127.0.0.1:2000/</a>;<br>                }<br>        }<br>############################################################################<br clear="all"><div><div><div><div><div><div><div><br>No URL change happens, and 404 (illegal-file-access) is obtained.<br><br><br></div><div>c)<br>############################################################################<br>server {<br>        listen 2001;<br>        location /78/ {<br><br>                        auth_basic 'Restricted';<br>                        auth_basic_user_file /home/2819163155b64c4c81f8608aa23c9faa/.htpasswd;<br>                        proxy_pass <a href="http://127.0.0.1:2000/">http://127.0.0.1:2000/</a>;<br>                }<br>        }<br>############################################################################<br clear="all"><br>The URL does changes from <a href="http://1.2.3.4:2001/78">http://1.2.3.4:2001/78</a> to <a href="http://1.2.3.4:2001/cgi-bin/webproc">http://1.2.3.4:2001/cgi-bin/webproc</a>, but a 404 is obtained.<br><br><br></div><div>d)<br></div><div>############################################################################<br>server {<br>        listen 2001;<br>        location /78/ {<br><br>                        auth_basic 'Restricted';<br>                        auth_basic_user_file /home/2819163155b64c4c81f8608aa23c9faa/.htpasswd;<br>                        proxy_pass <a href="http://127.0.0.1:2000">http://127.0.0.1:2000</a>;<br>                }<br>        }<br>############################################################################<br clear="all"><br>No URL change happens, and 404 (illegal-file-access) is obtained.<br><br><br></div><div>So, I guess c) is the closest to doing a url-rewrite, but I wonder why am I getting a 404, even though the URL-change is perfect.<br><br><br></div><div>Any ideas please?<br></div><div><br><br><div class="gmail_signature">Thanks and Regards,<br>Ajay<br></div>
</div></div></div></div></div></div></div></div>