From 5c365f41d14831ef685f0a18519639de313419cb Mon Sep 17 00:00:00 2001 From: hhhkkk520 Date: Fri, 20 May 2022 20:42:24 +0200 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0README=E3=80=81=E5=9B=9B?= =?UTF-8?q?=E4=B8=AAFAQ=E8=8B=B1=E6=96=87=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 3 +++ docs/en_US/guide/q2.md | 5 +++- docs/en_US/guide/q3.md | 53 +++++++++++++++++++++++++++++++++++++++++- docs/en_US/guide/q4.md | 4 +++- docs/en_US/guide/q5.md | 6 ++++- 5 files changed, 67 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c579a0a0..8c8a0a4b 100644 --- a/README.md +++ b/README.md @@ -4,3 +4,6 @@ npm i npm run dev ``` + +当你增加文档时,请同步添加其他语言的文档 +When you add a new document, please add document in other languages at the same time \ No newline at end of file diff --git a/docs/en_US/guide/q2.md b/docs/en_US/guide/q2.md index e94e28aa..3609b1ec 100644 --- a/docs/en_US/guide/q2.md +++ b/docs/en_US/guide/q2.md @@ -1 +1,4 @@ -q2 \ No newline at end of file +#### Let the Agent start/on-line, and the self-test process of the problem +1. Run `//opt/nezha/agent/nezha-agent -s IP/Domin(Panel IP or Domain not connected to CDN):port(Panel RPC port) -p secret(Agent Secret) -d` Check the logs to see if the timeout is due to a DNS problem or poor network +2. `nc -v domain/IP port(Panel RPC port)` or `telnet domain/IP port(Panel RPC port)` to check if it' s a network problem, check the inbound and outbound firewall between the local machine and the panel server, if you can' t determine the problem you can check it with the port checking tool provided by +3. If the above steps work and the Agent is online, please try to turn off SELinux on the panel server. [How to close SELinux?](https://www.google.com/search?q=How+to+disable+SELinux) \ No newline at end of file diff --git a/docs/en_US/guide/q3.md b/docs/en_US/guide/q3.md index d22aac2f..84223c88 100644 --- a/docs/en_US/guide/q3.md +++ b/docs/en_US/guide/q3.md @@ -1 +1,52 @@ -q3 \ No newline at end of file +#### Reverse Proxy gRPC Port (support Cloudflare CDN) +Use Nginx or Caddy to reverse proxy gRPC + +- Nginx configuration files + +```nginx +server { + listen 443 ssl http2; + listen [::]:443 ssl http2; + server_name data.example.com; # The domain name where the Agent connects to Dashboard + + ssl_certificate /data/letsencrypt/fullchain.pem; # Your domain certificate path + ssl_certificate_key /data/letsencrypt/key.pem; # Your domain's private key path + + underscores_in_headers on; + + location / { + grpc_read_timeout 300s; + grpc_send_timeout 300s; + grpc_pass grpc://localhost:5555; + } +} +``` + +- Caddy configuration files + +``` +data.example.com:443 { # The domain name where the Agent connects to Dashboard + reverse_proxy { + to localhost:5555 + transport http { + versions h2c 2 + } + } +} +``` + +Dashboard Configuration + +- First login to the Dashboard and enter the admin panel, go to the settings page, fill in the `CDN Bypassed Domain/IP` with the domain name you configured in Nginx or Caddy, for example `data.example.com`, and save it. +- Then open the `/opt/nezha/dashboard/data/config.yaml` file in the panel server and change `proxygrpcport` to the port that Nginx or Caddy is listening on, such as `443` as set in the previous step. Since we have SSL/TLS enabled in Nginx or Caddy, we need to set `tls` to `true`, restart the panel when you are done. + +Agent Configuration + +- Log in to the admin panel, copy the one-click install command, and run the one-click install command on the corresponding server to reinstall the agent. + +Enable Cloudflare CDN (optional) + +According to Cloudflare gRPC requirements: gRPC services must listen on port 443 and must support TLS and HTTP/2. +So if you need to enable CDN, you must use port 443 when configuring Nginx or Caddy reverse proxy gRPC and configure the certificate (Caddy will automatically apply and configure the certificate). + +- Log in to Cloudflare and select the domain you are using. Go to the `Network` page and turn on the `gRPC` switch, then go to the `DNS` page, find the resolution record of the domain with gRPC configuration, and turn on the orange cloud icon to enable CDN. \ No newline at end of file diff --git a/docs/en_US/guide/q4.md b/docs/en_US/guide/q4.md index 02b199a8..60af7eed 100644 --- a/docs/en_US/guide/q4.md +++ b/docs/en_US/guide/q4.md @@ -1 +1,3 @@ -q4 \ No newline at end of file +#### Real-time channel disconnection/online terminal connection failure ++ If you are using a CDN, please make sure that the CDN provider provides WebSocket service and that WebSocket is enabled ++ Confirm that you are using a reverse proxy requires special configuration of the WebSocket for the `/ws` and `/terminal` paths, you can [click here](/en_US/guide/dashboard.html#configure-reverse-proxy) to see the reverse proxy configuration \ No newline at end of file diff --git a/docs/en_US/guide/q5.md b/docs/en_US/guide/q5.md index e61aa1df..1f719111 100644 --- a/docs/en_US/guide/q5.md +++ b/docs/en_US/guide/q5.md @@ -1 +1,5 @@ -q5 \ No newline at end of file +#### How do I migrate my data to the new server and restore my backups? + +1. First use the one-click script and select `Stop Panel` +2. Compress the `/opt/nezha` folder to the same path as the new server +3. Run the one-click script in the new server, select `Launch Panel` \ No newline at end of file