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. 《.NET和Java之争》 读后感

    原文地址:https://www.cnblogs.com/adalovelacer/p/dotnet-vs-java.html 这是博客园被推荐上首页的文章,本着好学的心态,点进去拜读... 我也不清 ...

  2. .NET 跨平台RPC框架DotNettyRPC

    DotNettyRPC 1.简介 DotNettyRPC是一个基于DotNetty的跨平台RPC框架,支持.NET45以及.NET Standard2.0 2.产生背景 传统.NET开发中遇到远程调用 ...

  3. Educational Codeforces Round 61 (Rated for Div. 2)-C. Painting the Fence 前缀和优化

    题意就是给出多个区间,要求去掉两个区间,使得剩下的区间覆盖范围最大. 当然比赛的时候还是没能做出来,不得不佩服大佬的各种姿势. 当时我想的是用线段树维护区间和,然后用单点判0,维护区间间断个数.然后打 ...

  4. iframe 高度自适应

    <iframe id="InputDetail" src style="width:100%"></iframe> <script ...

  5. java工程师的成长历程

    2019年2月 这是我站在刚入行的角度,对自己未来的发展做出的初步的规划,以后慢慢调整 一. 初级java工程师 1.熟悉java的基本语法,拥有面向对象的思维,熟悉javaSE的核心类库 2.学习j ...

  6. django rest framework serializers

    django rest framework serializers序列化   serializers是将复杂的数据结构变成json或者xml这个格式的 serializers有以下几个作用:- 将qu ...

  7. [BJOI2019]排兵布阵——分组背包

    题目链接: [BJOI2019]排兵布阵 对于每座堡垒,将$s$个对手排序,显然如果安排的兵力能打败第$i$个对手就一定能打败前$i-1$个. 那么对于第$i$座城堡,可以看做有$s+1$个物品(可以 ...

  8. 文本编辑利器Notepad++ 10个强大而又鲜为人知的特性【转】

    文本编辑利器Notepad++ 10个强大而又鲜为人知的特性 - 为程序员服务

  9. loadrunner断言多结果返回

    有这么一个场景,接口返回的多个状态都是正常的,那么在压测的时候,断言就需要多 init里面执行登录,根据返回获取到tokenId action中,执行登录后的操作,获取响应返回的状态,把正确的状态个数 ...

  10. CPU监控

    题目描述 Bob需要一个程序来监视CPU使用率.这是一个很繁琐的过程,为了让问题更加简单,Bob会慢慢列出今天会在用计算机时做什么事. Bob会干很多事,除了跑暴力程序看视频之外,还会做出去玩玩和用鼠 ...