I have a proxied nuxt app set up like this:
location / {
proxy_pass http://localhost:3011/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
This works great. Now I want to restrict it for development purposes so only my team have access to it.
I cannot use IPs because some team members have dynamic IP. So I stumbled upon auth_basic and set it up by adding:
auth_basic "Restricted";
auth_basic_user_file /etc/apache2/.htpasswd;
This also works fine as far as restriction goes. The problem is that it uses the Authorization header and that interferes with our app's authentication mechanism.
Is there any way to make nginx use another header like maybe X-Authorization?