listen 80;
server_name yourhostname;
access_log off;
location / {
proxy_pass http://127.0.0.1:8888;
# websocket support
proxy_http_version 1.1;
proxy_set_header Upgrade "websocket";
proxy_set_header Connection "Upgrade";
}
}
最开始没有配置websocket,发现只能访问Home页,也可以新建文件,编写代码。但是不能运行,显示无法连接到服务。
增加websocket相关配置后成功解决。