I am trying to find the appropriate NGINX configuration in order to apply Basic Auth at the /location and pass (proxy_pass) the locations to the appropriate path, avoiding any CORS.
default.conf: |
server {
listen 80 default_server;
location / {
auth_basic "Restricted";
auth_basic_user_file .htpasswd;
proxy_set_header Host $host;
proxy_pass http://www.test1.com:84;
}
location /my/account {
proxy_pass_request_headers on;
proxy_pass http://www.test1.com:84/my/account;
}
location /imageproperties/listing {
proxy_pass_request_headers on;
proxy_pass http://www.test1.com:84/imageproperties/listing;
}
location /imageproperties/selling {
proxy_pass_request_headers on;
proxy_pass http://www.test1.com:84/imageproperties/buying;
}
}
Is there any regex that can replace the location /imageproperties and use proxy_pass that will pass all requests via the location.
thank you.