How to setup simple proxy with auth command for secure browsing?

20 Replies, 1904 Views

Hey! For a quick and dirty solution, you can use `nginx` as a reverse proxy with auth. It’s not the most common use case, but it works.

Add this to your nginx config:
```
location / {
proxy_pass http://your_backend;
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/.htpasswd;
}
```

Then create the `.htpasswd` file with `htpasswd -c /etc/nginx/.htpasswd username`.

It’s a bit hacky, but it’s simple and effective.

Messages In This Thread



Users browsing this thread: 1 Guest(s)