refactor(nginx配置): 重构nginx配置为伪静态文件并删除旧配置

将nginx配置从nginx.conf文件迁移到新的伪静态文件,删除旧的nginx.conf
新的伪静态配置专注于URL重写规则,移除了PHP处理等无关配置
This commit is contained in:
2025-11-25 17:49:39 +08:00
parent 9b9d1b9b64
commit c035380ea7
2 changed files with 10 additions and 31 deletions
-31
View File
@@ -1,31 +0,0 @@
# Nginx配置文件 - 适用于wangpu_auth API
server {
listen 80;
server_name localhost;
root c:\Users\吴展鹏\wangpu_auth;
# 访问日志和错误日志
access_log logs/access.log;
error_log logs/error.log;
# 将所有请求重定向到index.php
location / {
# 检查请求的文件或目录是否存在
if (!-e $request_filename) {
# 保留查询字符串,重写所有请求到index.php
rewrite ^/(.*)$ /index.php?$args last;
}
}
# 处理PHP文件
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
# 确保传递所有查询参数
fastcgi_param QUERY_STRING $query_string;
}
}
+10
View File
@@ -0,0 +1,10 @@
# nginx伪静态信息
# 将所有请求重定向到index.php
location / {
# 检查请求的文件或目录是否存在
if (!-e $request_filename) {
# 保留查询字符串,重写所有请求到index.php
rewrite ^/(.*)$ /index.php?$args last;
}
}