This document provides instructions on how to configure Nginx to proxy requests to Attu, a web-based GUI for Milvus.
Nginx: Ensure Nginx is installed on your server. You can install it using your package manager:
sudo apt-get install nginx # For Debian/Ubuntu
sudo yum install nginx # For CentOS/RHEL
brew install nginx # For Mac OS
Attu:
docker run -p 3000:3000 -e HOST_URL=http://localhost:8080/attu zilliz/attu:v2.4.4
The HOST_URL
environment variable specifies the URL where Attu is hosted. In this case, it is set to http://localhost:8080/attu/
.
Open your Nginx configuration file for editing. This is typically located at /etc/nginx/nginx.conf
or in the /etc/nginx/sites-available/
directory.
Add the following server block configuration:
server {
listen 8080;
server_name localhost;
location /attu/ {
proxy_pass http://localhost:3000/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
location /socket.io/ {
proxy_pass http://localhost:3000/socket.io/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
This configuration sets up a proxy for Attu running on localhost:3000
and maps it to localhost:8080/attu/
, directing all requests to the specified location.
After updating the Nginx configuration, restart the Nginx service to apply the changes:
sudo systemctl restart nginx # for Debian/Ubuntu
sudo systemctl restart nginx # for CentOS/RHEL
brew services restart nginx # for Mac OS
You can now access Attu through the proxy at http://localhost:8080/attu/
.
/var/log/nginx/error.log
for any configuration errors.By following these steps, you can configure Nginx to proxy requests to Attu, allowing you to use Attu behind a proxy server. This setup is useful for environments where direct access to Attu is restricted or when you want to centralize access through a single entry point.
For further assistance, refer to the official Nginx documentation and Attu documentation.
Feel free to modify this document according to your specific requirements.