Skip to main content

HTTP

Note

Affected by the characteristics of the system architecture, when the system access address changes due to configuring the proxy, the docker-compose.yaml configuration file needs to be adjusted simultaneously.

As shown in the figure below, please modify the value of the ENV_ADDRESS_MAIN environment variable to the actual access address, and restart the service after the modification is completed to make it effective.

For earlier versions: If ENV_ADDRESS_MAIN has not been defined in your environment configuration, please modify the three parameters ENV_MINGDAO_PROTO, ENV_MINGDAO_HOST and ENV_MINGDAO_PORT accordingly to keep the configuration logic consistent.

Nginx configuration example​

If you need to access services through HTTP protocol proxy, you can refer to the following Nginx reverse proxy configuration example:

upstream hdp {
server Server IP:8880; #Change it to your system intranet IP and port
}

server {
listen 80;
server_name _;
access_log /data/logs/weblogs/hdp.log main; #Log path can be customized
error_log /data/logs/weblogs/hdp.error.log; #Log path can be customized

underscores_in_headers on;
client_max_body_size 2048m;
gzip on;
gzip_proxied any;
gzip_disable "msie6";
gzip_vary on;
gzip_min_length 512;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_types text/plain text/css application/json application/x-javascript application/javascript application/octet-stream text/xml application/xml application/xml+rss text/javascript image/jpeg image/gif image/png;

location / {
set $real_ip '';
if ($http_x_real_ip) {
set $real_ip $http_x_real_ip;
}
if ($http_x_real_ip = '') {
set $real_ip $remote_addr;
}
proxy_set_header X-Real-IP $real_ip;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://hdp;
}

#IM required
location ~ /mds2 {
proxy_set_header Host $http_host;
proxy_hide_header X-Powered-By;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://hdp;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection upgrade;
}

#Used to support SSE streaming responses and long connection requests, turning off proxy buffering
location ~ ^/(agent|api/workflow/api/sse/chat) {
set $md_real_ip '';
if ($http_x_real_ip) {
set $md_real_ip $http_x_real_ip;
}
if ($http_x_real_ip = '') {
set $md_real_ip $remote_addr;
}
proxy_buffering off;
proxy_read_timeout 30m;
proxy_send_timeout 30m;
client_max_body_size 16m;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $md_real_ip;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-HTTP-Method-Override "";
proxy_pass http://hdp;
proxy_redirect default;
}
}

If you want to configure a new access address while retaining the original access method, please refer to Multiple Access Address Configuration.