can't setup http basic auth
mr-v-v-v opened this issue · comments
⚠️ 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