香港云服务器关于TP3.2nginx下配置子域名

作者头像
6G站长网 本文作者

2026-9-19 阅读 10 约 5分钟读完

评论0

还在找香港云服务器关于TP3.2nginx下配置子域名的靠谱教程?6G 站长网整理了香港云服务器关于TP3.2nginx下配置子域名从入门到精通的实操指南,解决新手操作云服务器时 “步骤混乱、配置出错、运维卡顿” 的核心痛点,手把手教你做好香港云服务器关于TP3.2nginx下配置子域名,哪怕是第一次接触云服务器也能快速上手。

香港云服务器关于TP3.2 nginx下配置子域名

1、nginx.conf
server {
listen 80;
server_name admin.enuoidc.com;
set $rootpath /data/wwwroot/;
client_max_body_size 128M;
access_log /var/log/nginx/log/www.enuoidc.com;
location / {
root $rootpath;
#下面这段伪静态支持
if (!-e $request_filename){
#rewrite ^/(.*) /index.php last;
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}
#上面这段伪静态支持
index index.php index.html index.htm;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location ~ .php$ {
root $rootpath;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param _FILENAME $rootpath$fastcgi__name;
include fastcgi_params;
}
location ~ /.ht {
deny all;
}
}


2、TP框架入口
.htaccess文件 //默认自带的即可

Options +FollowSymlinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]




3、TP框架App/commcon/conf文件
'APP_SUB_DOMAIN_DEPLOY' => 0, // 开启子域名或者IP配置
'APP_SUB_DOMAIN_RULES' => array(
'admin' => 'Admin', // 后台访问网站
),


一诺网络香港免备案专区,提供「香港增强云服务器」和「香港特惠云服务器」两种类型的高可用弹性计算服务,搭载新一代英特尔®至强®铂金处理器,接入CN2低延时高速回国带宽线路,网络访问顺滑、流畅。机房网络架构采用了BGP协议的解决方案可提供多线路互联融合网络,使得不同网络运营商线路的用户都能通过最佳路由实现快速访问。香港云服务器低至29元/月,购买链接:https://www.enuoidc.com/vps.html?typeid=2

上一篇 osgearth在ubuntu美国云服务器上运行稳定吗 下一篇 香港云服务器ping或者ssh发生connect错误
评论
评论已关闭