网站首页 > 技术教程 正文
nginx.conf
server {
listen 80;
server_name admin.xxx.com;
set $rootpath /data/wwwroot/;
client_max_body_size 128M;
access_log /var/log/nginx/log/www.xxx.com.access.log;
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;
}
}
TP框架入口
.htaccess文件 //默认自带的即可
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
</IfModule>
TP框架App/commcon/conf文件
'APP_SUB_DOMAIN_DEPLOY' => 0, // 开启子域名或者IP配置
'APP_SUB_DOMAIN_RULES' => array(
'admin' => 'Admin', // 后台访问网站
),
猜你喜欢
- 2024-10-10 使用 nginx 同域名下部署多个 vue 项目,并使用反向代理
- 2024-09-12 踩坑记录之MinIO添加HTTPS访问(邮箱访问记录多地登录失败是否意味着邮箱被侵入)
- 2024-09-12 申请免费证书、域名解析以及nginx部署配置https为微信小程序服务
- 2024-09-12 Nginx快速入门之Nginx反向代理与负载均衡
- 2024-09-12 宝塔面板如何用uwsgi与nginx快速部署Django项目
- 2024-09-12 使用 nginx 实现在同一个微信公众号授权域名下访问正式版和测试版
- 2024-09-12 使用nginx:1.24.0-bullseye部署Nginx域名、端口、子目录配置方法
- 2024-09-12 Nginx实现301跳转至https的根域名展示
- 2024-09-12 配置nginx代理grafana实现域名访问
- 2024-09-12 通过Nginx完美解决多个项目共用一个端口「80、443等等」
你 发表评论:
欢迎- 最近发表
- 标签列表
-
- 下划线是什么 (87)
- 精美网站 (58)
- qq登录界面 (90)
- nginx 命令 (82)
- nginx .http (73)
- nginx lua (70)
- nginx 重定向 (68)
- Nginx超时 (65)
- nginx 监控 (57)
- odbc (59)
- rar密码破解工具 (62)
- annotation (71)
- 红黑树 (57)
- 智力题 (62)
- php空间申请 (61)
- 按键精灵 注册码 (69)
- 软件测试报告 (59)
- ntcreatefile (64)
- 闪动文字 (56)
- guid (66)
- abap (63)
- mpeg 2 (65)
- column (63)
- dreamweaver教程 (57)
- excel行列转换 (56)
本文暂时没有评论,来添加一个吧(●'◡'●)