作为更目录在apache配置文件里面加入以下配置
# Proxy to Portainer
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:9000/
ProxyPassReverse / http://127.0.0.1:9000/
RequestHeader set X-Forwarded-Proto "https"
ProxyVia Block
<Proxy *>
Require all granted
</Proxy>
<Location /api/websocket/>
RewriteEngine on
RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC]
RewriteCond %{HTTP:CONNECTION} Upgrade$ [NC]
RewriteRule /api/websocket/(.*) ws://127.0.0.1:7900/api/websocket/$1 [P]
</Location>
作为网站的子目录