thinkphp5 nginx下部署隐藏后台登录入口地址的方法

thinkphp5 nginx下部署隐藏后台登录入口地址的方法

在Apache环境下很好布署,只需要在修改application/config.php中deny_module_list的值,其中默认已经有common,我们添加admin,改成[‘common’, ‘admin’],然后再修改项目public目录下的admin.php,将其改名为admin_d75KABNWt.php即可。
但这个放到nginx下访问会有问题,
现在我把修改好的配置分享出来,希望有需要的可以查看
[php]
server {
listen 8080;
server_name sj.sayii.com 127.0.0.1;
root ‘F:/html/shengjiang/public’;

location ~ \.php(.*)$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
#fastcgi_param PATH_INFO $2;
include fastcgi_params;
}
location ~ /\.ht {
deny all;
}
location / {
index index.php index.html index.htm;
#autoindex on;
try_files $uri $uri/ /?$args;
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php?s=$1 last;
}
}
}
[/php]

发表评论

© 2022. powered by PHP 个人小站