server {
listen 80;
server_name c1.aaa.cn ;
root "D:/phpstudy_pro/WWW/aqb";
location / {
index index.php index.html error/index.html;
include D:/phpstudy_pro/WWW/aqb/nginx.htaccess;
autoindex off;
if (!-e $request_filename)
{
rewrite ^/(.*)$ /index.php?s=/$1 last;
break;
}
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
以上 是部署在windows PHP studypro8.1.1.3 版本上 环境php 7.3.4nts ,Nginx 1.15.11 ,Mysql 5.7.26 现 系统 网站正常运行 ,迁移到另外的windows 也没有问题
先迁移到Ubuntu , BT版本9.5.0 Nginx1.26.1 Php7.3.31 Mysql 5.7.44 ,配置如下
server
{
listen 80;
server_name c1.aaa.cn;
index index.php index.html index.htm default.php default.htm default.html;
root /www/wwwroot/c1.aaa.cn;
#CERT-APPLY-CHECK--START
# 用于SSL证书申请时的文件验证相关配置 -- 请勿删除
include /www/server/panel/vhost/nginx/well-known/c1.aaa.cn.conf;
#CERT-APPLY-CHECK--END
#SSL-START SSL相关配置,请勿删除或修改下一行带注释的404规则
#error_page 404/404.html;
#SSL-END
#ERROR-PAGE-START 错误页配置,可以注释、删除或修改
error_page 404 /404.html;
#error_page 502 /502.html;
#ERROR-PAGE-END
#PHP-INFO-START PHP引用配置,可以注释或修改
include enable-php-73.conf;
#PHP-INFO-END
#REWRITE-START URL重写规则引用,修改后将导致面板设置的伪静态规则失效
include /www/server/panel/vhost/rewrite/c1.aaa.cn.conf;
#REWRITE-END
#禁止访问的文件或目录
location ~ ^/(\.user.ini|\.htaccess|\.git|\.env|\.svn|\.project|LICENSE|README.md)
{
return 404;
}
#一键申请SSL证书验证目录相关设置
location ~ \.well-known{
allow all;
}
#禁止在证书验证目录放入敏感文件
if ( $uri ~ "^/\.well-known/.*\.(php|jsp|py|js|css|lua|ts|go|zip|tar\.gz|rar|7z|sql|bak)$" ) {
return 403;
}
location ~ \.php$ {
try_files $uri =404; # 先检查文件是否存在
include fastcgi.conf;
fastcgi_pass unix:/tmp/php-cgi-73.sock;
fastcgi_index index.php;
# 可选:调整超时时间
fastcgi_read_timeout 60s;
# 如果 fastcgi.conf 中没有,则需要保留这行
# fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
error_log /dev/null;
access_log /dev/null;
}
location ~ .*\.(js|css)?$
{
expires 12h;
error_log /dev/null;
access_log /dev/null;
}
access_log /www/wwwlogs/c1.aaa.cn.log;
error_log /www/wwwlogs/c1.aaa.cn.error.log;
}
伪静态配置为
if (!-e $request_filename)
{
rewrite ^/(.*)$ /index.php?s=/$1 last;
break;
}
现在的问题是 bt 部署的系统 ,首页正常显示,点击其他链接 页面不跳转?各位亲 谁给指导一下 谢谢 谢谢
|
|