Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't setup http basic auth #1358

Open
1 task done
mr-v-v-v opened this issue Nov 6, 2023 · 0 comments
Open
1 task done

can't setup http basic auth #1358

mr-v-v-v opened this issue Nov 6, 2023 · 0 comments

Comments

@mr-v-v-v
Copy link

mr-v-v-v commented Nov 6, 2023

⚠️ Check for existing issues before proceeding. ⚠️

  • I have searched the existing issues, and there is no existing issue for my problem

Where are you using SuperAGI?

Linux

Which branch of SuperAGI are you using?

Main

Do you use OpenAI GPT-3.5 or GPT-4?

GPT-3.5

Which area covers your issue best?

Installation and setup

Describe your issue.

Hi Team!
Trying setup HTTP basic auth. But have issues. Could you help?

nginx conf:

server {
    server_name super-agi.my-domain.net;

    location / {
        proxy_pass http://localhost:3001; 
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;


        auth_basic "Restricted Access";
        auth_basic_user_file /etc/nginx/.htpasswd;
    }


    location /api {
        proxy_pass http://localhost:3001;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

        auth_basic off;
    }

    location /_next/webpack-hmr {
        proxy_pass http://localhost:3001;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;

        auth_basic off;
    }


    listen 443 ssl;
    ssl_certificate /etc/letsencrypt/live/super-agi.my-domain.net/fullchain.pem; 
    ssl_certificate_key /etc/letsencrypt/live/super-agi.my-domain.net/privkey.pem; 
    include /etc/letsencrypt/options-ssl-nginx.conf; 
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; 

}
server {
    if ($host = super-agi.my-domain.net) {
        return 301 https://$host$request_uri;
    } 

    server_name super-agi.my-domain.net;
    listen 80;
    return 404; 

}

nginx/default.conf inside project (mounted volume)

server {
  listen 80;
  

  auth_basic "Restricted Access";
  auth_basic_user_file /etc/nginx/.htpasswd;

  location / {
    proxy_pass http://gui:3000;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  }

  location /api {
    proxy_pass http://backend:8001;
    client_max_body_size 50M;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    rewrite ^/api/(.*) /$1 break;


    auth_basic off;
     proxy_set_header Authorization "";
  }
  location /_next/webpack-hmr {
    proxy_pass http://gui:3000;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host $host;
    proxy_cache_bypass $http_upgrade;


    auth_basic off;
    proxy_set_header Authorization "";
}
}

in backend container I have error:

INFO:     192.168.16.7:53728 - "POST /users/add HTTP/1.0" 422 Unprocessable Entity

How to replicate your Issue?

setup basic auth

Upload Error Log Content

"POST /users/add HTTP/1.0" 422 Unprocessable Entity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant