As the question implies I want to allow full access to my website if the X-Auth
HTTP header is set and contains a specific string. If this is not the case, HTTP basic authentication should be triggered. Something like this:
if ($http_x_auth = "some_string") {
allow access;
} else {
auth_basic "Authentication";
auth_basic_user_file /etc/nginx/security_http_basic_auth_file;
}
Unfortunately NGINX does not allow if else statements. Does anyone have an idea how this could be done?