Answer the question
In order to leave comments, you need to log in
How to set up basic auth and proxy pass?
I want the backend not to deal with basic auth, I want to shift this task to nginx. Here is the config:
server {
listen 443 ssl default_server;
server_name myhost.com;
include /etc/nginx/includes/listen_ssl;
client_max_body_size 100m;
location / {
auth_basic "Restricted Content";
auth_basic_user_file /storage/server/security/.htpasswd;
proxy_pass http://127.0.0.1:8080;
}
}
Answer the question
In order to leave comments, you need to log in
The answer to your question is in /var/log/nginx/error.log
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question