basicAuthVCL4.vcl
sub vcl_recv { | |
if (! req.http.Authorization ~ "Basic dXNlcm5hbWU6cGFzc3dvcmQ=") { | |
# This is checking for base64 encoded username:password combination | |
return(synth(401, "Authentication required")); | |
} | |
unset req.http.Authorization; | |
} | |
sub vcl_synth { | |
if (resp.status == 401) { | |
set resp.status = 401; | |
set resp.http.WWW-Authenticate = "Basic"; | |
return(deliver); | |
} | |
} |
This comment has been minimized.
This comment has been minimized.
echo dXNlcm5hbWU6cGFzc3dvcmQ= | base64 --decode |
This comment has been minimized.
This comment has been minimized.
Thanks |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
If you want to generate base64-encoded string with login and password you can use this command:
echo -n "USER:PASSWORD" | base64