Closed berlin2123 closed 7 months ago
Solved by adding three lines into nginx config file:
location / {
# enable hot-reloading or auto-refresh by the following three lines
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_pass http://localhost:8000$request_uri;
}
Seeing https://github.com/webpack/webpack-dev-server/issues/804 or https://www.wheelhouse.be/insights/setting-up-hot-reloading-behind-a-reverse-proxy
[ not bug of auto-build. but an issue on using it. ]
I am using Nginx as a front-end reverse proxy web-server, and sphinx-autobuild as back-end web-server.
back-end has make http://ip.addr:8000, works fine. front-end has make reverse proxy works, at last could open all pages fine by http://my.domain.name
However, the change of a page do not auto-refresh when opened by http://my.domain.name. Only update the page when manually refreshed. I have tested on open page by http://ip.addr:8000, directly to the sphinx-autobuild server, all page will auto-refresh after any changes.
here is the config file of nginx:
So any way to make the auto-refresh enabled pass through the nginx reverse proxy ?