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. Ubuntu16.04安装和配置RabbitMQ

    1.RabbitMQ安装前需要erlang环境 apt-get install erlang-nox # 安装erlang erl # 查看relang语言版本,成功执行则说明relang安装成功 2 ...

  2. commons-lang3之StringUtils

    字符串是一种在开发中经常使用到的数据类型,对字符串的处理也变得非常重要,字符串本身有一些方法,但都没有对null做处理,而且有时可能还需要做一些额外处理才能满足我们的需求,比如,要判断某个字符串中是否 ...

  3. matlab函数int2str, num2str, str2num

    函数名:int2str 功能:将整数值转换为字符串 输入格式:str = int2str(N) 备注:就将该值四舍五入后转换为字符串,接受向量和矩阵输入. 如果是向量和矩阵输入,列数字之间会补加两个空 ...

  4. WMI测试器

    WMI是... 来自百度百科:WMI(Windows Management Instrumentation,Windows 管理规范)是一项核心的 Windows 管理技术:用户可以使用 WMI 管理 ...

  5. ABP实践(2)-ASP.NET Core 2.x版本EntityFrameworkCore(EF)使用mysql数据库

    上一篇中EntityFrameworkCore默认使用的是微软的sql server,本篇改为mysql步骤如下: 1,在基础层xxx.EntityFrameworkCore依赖项添加Pomelo.E ...

  6. echarts实时数据图表

    import React, { PureComponent } from 'react'; import ReactEcharts from 'echarts-for-react'; import m ...

  7. .net使用SqlBulkCopy类操作DataTable批量插入数据库数据,然后分页查询坑

    在使用SqlBulkCopy类操作DataTable批量插入数据,这种操作插入数据的效率很高,就会导致每一条数据在保存的时间基本一样,在我们分页查询添加的数据是,使用数据的添加时间来排序就会出现每页的 ...

  8. C#给字符串赋予字面值——字符串插入、转义序列的使用

    1.占位符.字符串插入 给字符串赋予字面值时,经常遇见在字符串中包含变量的情况,用连接符进行拼接.转换的方式比较麻烦.还容易出错.C#提供了较为便捷的处理方式,即‘占位符’,以及C#6的新功能‘插入字 ...

  9. C++编程音视频库ffmpeg的pts时间换算方法

    ffmpeg中的pts,dts,duration时间记录都是基于timebase换算,我们主要分析下pts的时间怎么换算,其它的是一样的换算.ffmpeg的时间换算对许多新接触同学算是一个大坑,很多刚 ...

  10. Making every developer more productive with Visual Studio 2019

    Today, in the Microsoft Connect(); 2018 keynote, Scott Guthrie announced the availability of Visual ...