我正在尝试反向代理瞧,它设法加载页面但未加载任何交互式组件。所有的下拉列表等都丢失了
[单元]
描述=瞧
#/usr/lib/systemd/system/voila.service
[Service]
Type=simple
PIDFile=/var/run/voila.pid
ExecStart=/opt/miniconda3/envs/f101_auto_root/bin/voila --port=8081 --no-browser --Voila.ip='0.0.0.0' /opt/html/app/f101_auto_app/admin.ipynb
User=root
WorkingDirectory=/home/a.dellecanne/notebooks/f101_auto_app
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
# /etc/httpd/conf.d/jupyter.conf
<VirtualHost *:8080>
ProxyPass /admin http://localhost:8081
ProxyPassReverse /admin http://localhost:8081
ProxyPass /user http://localhost:8082
ProxyPassReverse /user http://localhost:8082
</VirtualHost>
它尝试加载的示例静态文件是,https://domain:8080/voila/static/require.min.js
如果我尝试运行https://domain:8080/user/voila/static/require.min.js
它会将其转换为 https://domain:8080/voila/files/voila/static/require.min.js
更新
在apache中添加了这些
ProxyPass /voila http://localhost:8082/voila
ProxyPassReverse /voila http://localhost:8082/voila
ProxyPass /api http://localhost:8082/api
ProxyPassReverse /api http://localhost:8082/api
https://domain:8080/voila/api/shutdown/f51257f9-fff0-4fab-99d3-d5dd33fa91f8
我仍然在前端收到一个文件的错误,这失败了
voila.js?v=46090122a7d2d199824ca7bea2689e0c47e3afee17ae658ae3ffb0d3c3e40de9775880806fc05709d877ac1ad192c3de674114ed1dbdbb615736350399a96991:68 WebSocket connection to 'wss://domain:8080/api/kernels/5db1703b-8c18-4c67-905e-78ae12ea75a2/channels?session_id=8c5d629a-136b-4db4-a49a-9e1def9ad503' failed:
更新网络套接字
<VirtualHost *:8080>
ServerName domain.com
RewriteEngine on
RewriteCond ${HTTP:Upgrade} websocket [NC]
RewriteCond ${HTTP:Connection} upgrade [NC]
RewriteRule /(.*) ws://localhost:8082/$1 [P,L]
ProxyPreserveHost On
ProxyPass /websocket ws://localhost:8082
ProxyPassReverse /websocket ws://localhost:8082
ProxyPass / http://localhost:8082/
ProxyPassReverse / http://localhost:8082/
</VirtualHost>