Welcome! Log In Create A New Profile


Limit Basic Auth User to 1 connection per user

Posted by badincite 
Limit Basic Auth User to 1 connection per user
January 22, 2021 05:44PM
Found this post on serverfault about this. I attempted to set the limit_conn limit to 1 but its still allowing more than one login. Trying to limit each user to a single session.

limit_conn_zone $remote_user zone=limit:10m;

server {
listen 80;
listen [::]:80;
server_name localhost;
auth_basic "Restricted Content";
auth_basic_user_file /etc/nginx/.htpasswd;
limit_conn limit 1;

#charset koi8-r;
#access_log /var/log/nginx/host.access.log main;

location / {
root /usr/share/nginx/html;
index index.html index.htm;

Re: Limit Basic Auth User to 1 connection per user
January 23, 2021 09:07AM
Just need to find away to limit concurrent sessions by user whether that's by limiting user access using an IP. So the each user can only access that system using from one public ip. Trying to find something in the documentation maybe I'm wording it wrong.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 77
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready