Development server of create-react-app does not auto refresh

后端 未结 17 1567
清酒与你
清酒与你 2020-12-01 07:30

I am following a tutorial on React using create-react-app. The application is created by create-react-app v1.3.0

create-react-app my-app

T

17条回答
  •  悲&欢浪女
    2020-12-01 08:00

    If you are running your app behind a reverse proxy / nginx (e.g. to enable https locally) you also need to enable websockets so it can detect the refresh:

    location /sockjs-node {
        proxy_pass http://dockerhost:5000/sockjs-node;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }
    

提交回复
热议问题