Skip to content

Commit b87dc56

Browse files
snowie2000zdz
authored andcommitted
Optimize the nginx way of applying custom themes.
Add a new Nezha theme
1 parent 03b626d commit b87dc56

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

README.md

+16-16
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,15 @@ ServerStatus-web 主题由 [@mjjrock](https://github.com/mjjrock) 修改提供
128128

129129
</details>
130130

131+
<details>
132+
<summary>ServerStatus-nezha 主题</summary>
133+
134+
ServerStatus-nezha 主题由 [@snowie2000](https://github.com/snowie2000) 修改提供,类似于哪吒探针v1,[主题地址](https://github.com/snowie2000/serverstatus-nezha-theme)
135+
136+
<img width="1425" alt="image" src="https://github.com/user-attachments/assets/2f0a9ca1-0d7d-472c-bf0d-eada396f6219">
137+
138+
</details>
139+
131140

132141
<details>
133142
<summary>v1.5.7 版本主题</summary>
@@ -481,34 +490,25 @@ python3 stat_client.py -a "http://127.0.0.1:8080/report" -u h1 -p p1 -n
481490
server {
482491
# ssl, domain 等其它 nginx 配置
483492
484-
# 反代 /report 请求
485-
location = /report {
486-
proxy_set_header Host $host;
487-
proxy_set_header X-Real-IP $remote_addr;
488-
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
489-
proxy_set_header X-Forwarded-Proto $scheme;
490-
proxy_set_header X-Forwarded-Host $host;
491-
proxy_set_header X-Forwarded-Port $server_port;
492-
493-
proxy_pass http://127.0.0.1:8080/report;
494-
}
495-
# 反代 json 数据请求
496-
location = /json/stats.json {
493+
# 自动反代所有请求
494+
location @proxy {
497495
proxy_set_header Host $host;
498496
proxy_set_header X-Real-IP $remote_addr;
499497
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
500498
proxy_set_header X-Forwarded-Proto $scheme;
501499
proxy_set_header X-Forwarded-Host $host;
502500
proxy_set_header X-Forwarded-Port $server_port;
501+
proxy_set_header Upgrade $http_upgrade;
502+
proxy_set_header Connection $http_connection;
503503
504-
proxy_pass http://127.0.0.1:8080/json/stats.json;
504+
proxy_pass http://127.0.0.1:8080;
505505
}
506-
# v1.4.0后,同样需要反代 /detail, /map
507506
508-
# 其它 html,js,css 等,走本地文本
507+
# 如果主题存在相关文件则使用,否则回退到上游
509508
location / {
510509
root /opt/ServerStatus/web; # 你自己修改的主题目录
511510
index index.html index.htm;
511+
try_files $uri $uri/ @proxy;
512512
}
513513
}
514514
```

0 commit comments

Comments
 (0)