vim /etc/nginx/sites-available/default   进入修改目录

1.正常项目配置

server {
listen 80 default_server;
listen [::]:80 default_server;

# SSL configuration
#
# listen 443 ssl default_server;
# listen [::]:443 ssl default_server;
root /var/www/php;

# Add index.php to the list if you are using PHP
index index.html index.htm index.nginx-debian.html index.php;

#server_name www.wudi.com; #网站的域名

location / {
try_files $uri $uri/ =404;
}

# pass PHP scripts to FastCGI server
location ~ \.php$ {
include fastcgi_params;
fastcgi_index index.php;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_read_timeout 10000;
}
}

2.tp框架配置

server {
listen 8081;

# SSL configuration
#
# listen 443 ssl default_server;
# listen [::]:443 ssl default_server;
root /var/www/tp5/public;

# Add index.php to the list if you are using PHP
index index.html index.htm index.php;

#server_name www.wudi.com; #网站的域名

location / {
#try_files $uri $uri/ =404;
if (!-e $request_filename){
rewrite ^/(.*)$ /index.php?s=/$1 last;
}
}

# pass PHP scripts to FastCGI server
location ~ \.php$ {
include fastcgi_params;
fastcgi_index index.php;

fastcgi_split_path_info ^(.+\.php)(/.+)$;

fastcgi_pass unix:/run/php/php7.0-fpm.sock;
# fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_read_timeout 10000;
}
}

3.phalcon框架下配置

server {
listen 8082;
# server_name
root /var/www/daifang/public;
index index.php index.html index.htm;
charset utf-8;

location / {
try_files $uri $uri/ /index.php?_url=$uri&$args;
}

location ~ \.php {
fastcgi_index /index.php;
include fastcgi_params;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}

# location ~ /\.ht {
# deny all;
# }
}

关于lnmp下 phalcon和tp框架下的nginx文件配置的更多相关文章

  1. tp框架下,数据库和编辑器都是utf-8, 输出中文却还是乱码

    输出: array(2) { [0]=> array(4) { ["id"]=> string(1) "1" ["user"]= ...

  2. 6月19 使用tp框架生成验证码及文件上传

    ThinkPHP中自带能生成验证码的类:ThinkPHP/Library/Think/Verify.class.php 默认情况下,验证码的字体是随机使用 ThinkPHP/Library/Think ...

  3. PHP.TP框架下商品项目的优化1-时间插件、鼠标所在行高亮、布局规划页面

    1.优化搜索表单中按时间搜索的功能 添加一个时间插件datetimepicker,在lst.html中,注意要导入jquery.min.js,此处从前文的在线编辑器中导入 <!-- 导入 --& ...

  4. 第一零五天上课 PHP TP框架下分页

    控制器代码(TestController.class.php) <?php namespace Home\Controller; use Home\Controller\EmptyControl ...

  5. 第一零三天上课 PHP TP框架下控制器的方法分离

    (1)配置信息 修改配置文件->Config.php (配置后,原先的控制方法无效) 'ACTION_BIND_CLASS' => TRUE, // 控制器方法分离 (2)在Control ...

  6. PHP.TP框架下商品项目的优化3-php封装下拉框函数

    php封装下拉框函数 因为在项目中会经常使用到下拉框,所以根据一个表中的数据制作下拉框函数,以便调用 //使用一个表的数据做下拉框函数 function buildSelect($tableName, ...

  7. 第一零四天上课 PHP TP框架下的文件上传

    控制器代码(TestController.class.php) <?php namespace Home\Controller; use Home\Controller\EmptyControl ...

  8. PHP.TP框架下商品项目的优化4-优化商品添加表单js

    优化商品添加表单js 思路 1.制作五个按钮 2.下面五个table 3.全部隐藏,点击则显示 4.点击第几个按钮就显示第几个table 具体操作 1.添加按钮 2.添加五个table并添加class ...

  9. PHP.TP框架下商品项目的优化2-图片优化

    图片存储.上传.显示优化 1.图片路径写进配置文件,当路径有变动时[因业务扩大,服务器存储图片空间不足等],只需修改配置文件,而不用修改代码 2.封装显示.上传.删除函数,实现代码重用 [可类比其他类 ...

随机推荐

  1. facebook marketing(市场营销) API(3)

    如果你只想管理广告,而不想管理BM,那就需要市场营销API了. 相关文章 通过BM api管理完相互授权后,就可以让自己的运营参与进行投放了(市场营销API也支持非BM操作,即广告主自己操作). 市场 ...

  2. SpringMVC 接受请求参数、作用域传值

    目录 原生servlet接收参数 Spring MVC最基础的参数获取 接收基本数据类型参数 方法参数列表和请求参数不一致的处理方式 接收对象引用数据类型 接收复选框这种多个同名的参数 接收obj.f ...

  3. jmeter学习记录--10--二次开发环境搭建

    JMeter源码集成到Eclipse.JMeter二次开发(1)-eclipse环境配置及源码编译 ,根据此文章记录将jmeter源码集成到myecplise 第一步:下载jmeter源码http:/ ...

  4. arale-cookie 使用

    https://www.npmjs.com/package/arale-cookie  arale-cookie 使用 define(function() { var Cookie = require ...

  5. Ajax设置自定义请求头的两种方法

    用自定义请求头token为例 方法一 $.ajax({ type: "post", url:"http://127.0.0.1:4564/bsky-app/templat ...

  6. html中滚动小球的demo

    类似于下图的效果: 代码: <!DOCTYPE html> <html> <head> <title>Promise animation</tit ...

  7. Capability配置简介

    什么是Capability desired capability的功能是配置Appium会话.他们告诉Appium服务器您想要自动化的平台和应用程序. Desired Capabilities是一组设 ...

  8. 支持“XXX”上下文的模型已在数据库创建后发生更改。请考虑使用 Code First 迁移更新数据库(http://go.microsoft.com/fwlink/?LinkId=238269)。

    在Global.asax文件中的Application_Start()方法中加入以下代码 Database.SetInitializer<XXX>(null);

  9. What Kind of Friends Are You? ZOJ 3960

    比赛的时候用vector交集做的...情况考虑的不全面  wrong到疯 赛后考虑全了情况....T了 果然 set_intersection  不能相信 嗯 不好意思 交集a了  第二个代码 求出来 ...

  10. Mergeable Stack ZOJ - 4016(list)

    ZOJ - 4016 vector又T又M list是以链表的方式存储的 是一个双向链表 元素转移操作中,不能一个个遍历加入到s中,list独有的splic函数可以在常数时间内实现合并(并删除源lis ...