Skip to content

Latest commit

 

History

History
46 lines (36 loc) · 1017 Bytes

README.md

File metadata and controls

46 lines (36 loc) · 1017 Bytes

在线日志


参考

部署

mvn clean package

java -jar  -Dcmd.tail.path=日志文件绝对路径 target/websocket-tail-1.0.0.jar

浏览器访问 http://localhost:8765/ 即可

nginx 配置

upstream ws_server {
  server 127.0.0.1:3000;
}

server {
  listen 80;
  server_name ws.repo;

  location / {
    proxy_pass http://ws_server/;
    proxy_redirect off;

    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
  }
}

核心配置就下面这三行

    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";