thinkphp nginx配置
2024-10-19 04:30:46
安装和配置:
http://www.cnblogs.com/Bonker/p/4252588.html
spawn-fcgi 要先安装和启动:(已过时)
sudo spawn-fcgi -a 127.0.0.1 -p -u www-data -g www-data -f /usr/bin/php5-cgi -C
新:
sudo service php5-fpm restart
tp的nginx配置
server {
listen ;
server_name jktest.sysu.edu; # 改成所配域名,在 /etc/hosts下增加
root /var/www/jktest; # 根地址
index index.html index.htm index.php; error_page /.html;
location = /.html {
return 'Sorry, File not Found!';
}
error_page /50x.html;
location = /50x.html {
root /usr/share/nginx/html; # windows用户替换这个目录
} location / {
try_files $uri @rewrite;
} location @rewrite {
set $static ;
if ($uri ~ \.(css|js|jpg|jpeg|png|gif|ico|woff|eot|svg|css\.map|min\.map)$) {
set $static ;
} if ($static = ) {
rewrite ^/(.*)$ /index.php?s=/$;
} } location ~ /Uploads/.*\.php$ {
deny all;
} location ~ \.php/ {
if ($request_uri ~ ^(.+\.php)(/.+?)($|\?)) { }
fastcgi_pass 127.0.0.1:;
include fastcgi_params;
fastcgi_param SCRIPT_NAME $;
fastcgi_param PATH_INFO $;
fastcgi_param SCRIPT_FILENAME $document_root$;
} location ~ \.php$ {
fastcgi_pass 127.0.0.1:;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
} location ~ /\.ht {
deny all;
}
}
最新文章
- nodejs之get/post请求的几种方式
- connect mysql from another host
- js简单的设置快捷键,hotkeys捕获键盘键和组合键的输入
- PHP的流程控制结构
- WIFI基本知识整理
- codeforces 652C Foe Pairs 水题
- HDU 1042 N!(高精度计算阶乘)
- easy ui 实现gridview效果
- Leetcode算法刷题:第100题 Same Tree
- DDS视图&;Button控件
- Android离线缓存
- 老李分享:《Java Performance》笔记1——性能分析基础 1
- laravel blade模板介绍
- 跟我一起读postgresql源码(九)——Executor(查询执行模块之——Scan节点(上))
- jsp篇 之 指令元素和动作元素
- Go-day01
- NodeJs学习相关网址
- JavaScrip(二)JavaScrip语法基础
- poj 3660 传递闭包 **
- 移动端视频h5表现问题汇总