From c035380ea7f290f06a4bdc2e3b6a2d3e40e59fcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=B1=95=E9=B9=8F?= Date: Tue, 25 Nov 2025 17:49:39 +0800 Subject: [PATCH] =?UTF-8?q?refactor(nginx=E9=85=8D=E7=BD=AE):=20=E9=87=8D?= =?UTF-8?q?=E6=9E=84nginx=E9=85=8D=E7=BD=AE=E4=B8=BA=E4=BC=AA=E9=9D=99?= =?UTF-8?q?=E6=80=81=E6=96=87=E4=BB=B6=E5=B9=B6=E5=88=A0=E9=99=A4=E6=97=A7?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将nginx配置从nginx.conf文件迁移到新的伪静态文件,删除旧的nginx.conf 新的伪静态配置专注于URL重写规则,移除了PHP处理等无关配置 --- nginx.conf | 31 ------------------------------- nginx伪静态 | 10 ++++++++++ 2 files changed, 10 insertions(+), 31 deletions(-) delete mode 100644 nginx.conf create mode 100644 nginx伪静态 diff --git a/nginx.conf b/nginx.conf deleted file mode 100644 index f413f10..0000000 --- a/nginx.conf +++ /dev/null @@ -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; - } -} diff --git a/nginx伪静态 b/nginx伪静态 new file mode 100644 index 0000000..64b530c --- /dev/null +++ b/nginx伪静态 @@ -0,0 +1,10 @@ + + # nginx伪静态信息 + # 将所有请求重定向到index.php + location / { + # 检查请求的文件或目录是否存在 + if (!-e $request_filename) { + # 保留查询字符串,重写所有请求到index.php + rewrite ^/(.*)$ /index.php?$args last; + } + }