Dear Nginx Users, I have a scenario that whenever a user hits the website ( https://abc.test.com), it should re-direct to the sub-path (/xxx/yyy/) of the website (ex: https://abc.test.com/xxx/yyy).
So re-direction to a website's sub-path (https://abc.test.com/xxx/yyy) is working. I have implemented http basic auth, so whenever the user is re-directed to sub-path /xxx/yyy/, the basic auth should come into effect and then the website has to be re-directed. The issue is basic auth is not coming into effect before re-directing to the web-site's sub-path it just re-directs. This is how my nginx config looks like listen 443 ssl; server_name aa.bb.com; set $backend "https://abc.test.com:8080/"; location / { proxy_pass $backend; proxy_pass_header Authorization; auth_basic "Access Denied or Restricted"; auth_basic_user_file /etc/nginx/.htpasswd; return 301 https://abc.test.com:8080/xxx/yyy/; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host aa.bb.com; client_max_body_size 10m; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_read_timeout 900; } } If you see above in the location block i am using basic auth just before the re-direction, but the basic auth is not in effect. Any ideas or suggestions are highly appreciated. nginx version: nginx/1.16.1 Thanks & Regards, Majid M A
_______________________________________________ nginx mailing list nginx@nginx.org http://mailman.nginx.org/mailman/listinfo/nginx