[GH-ISSUE #1] nginx伪静态错误,宝塔 #1

Closed
opened 2026-02-26 17:45:56 +03:00 by kerem · 1 comment
Owner

Originally created by @wintsa123 on GitHub (Mar 11, 2019).
Original GitHub issue: https://github.com/D3CODING/KMS-Server-WebUI/issues/1

nginx: [emerg] invalid condition "%" in /www/server/panel/vhost/rewrite/kms.wintsa.cn.conf:4
nginx: configuration file /www/server/nginx/conf/nginx.conf test failed
how to do.

Originally created by @wintsa123 on GitHub (Mar 11, 2019). Original GitHub issue: https://github.com/D3CODING/KMS-Server-WebUI/issues/1 nginx: [emerg] invalid condition "%" in /www/server/panel/vhost/rewrite/kms.wintsa.cn.conf:4 nginx: configuration file /www/server/nginx/conf/nginx.conf test failed how to do.
kerem closed this issue 2026-02-26 17:45:56 +03:00
Author
Owner

@D3CODING commented on GitHub (Mar 12, 2019):

本程序测试环境为Apache,Nginx规则为在线转换生成,未测试稳定性,请尝试使用以下规则代替:

location / {
  if (!-e $request_filename){
    rewrite ^(.+)$ /$1.php break;
  }
}

如仍未正常,请尝试修改HTML文件为如下内容

  1. 第46行
<p>4、如果激活失败可先<a href="./clean.php">下载清除脚本</a>并运行后再次尝试激活。</p>
  1. 第50行
<form action="./kms.php" method="post" role="form">

修改后不需要设置伪静态即可运行,但是无法隐藏网址中的php后缀。

<!-- gh-comment-id:472014320 --> @D3CODING commented on GitHub (Mar 12, 2019): 本程序测试环境为Apache,Nginx规则为在线转换生成,未测试稳定性,请尝试使用以下规则代替: ``` location / { if (!-e $request_filename){ rewrite ^(.+)$ /$1.php break; } } ``` 如仍未正常,请尝试修改HTML文件为如下内容 1. 第46行 ``` <p>4、如果激活失败可先<a href="./clean.php">下载清除脚本</a>并运行后再次尝试激活。</p> ``` 2. 第50行 ``` <form action="./kms.php" method="post" role="form"> ``` 修改后不需要设置伪静态即可运行,但是无法隐藏网址中的php后缀。
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/KMS-Server-WebUI#1
No description provided.