nginx php 配置

/***************************************************************************************                               nginx php 配置* 说明:*     配置一下nginx和php的开发环境,这个主要是为了将来运行的TI的Matrix GUI。*                 *                                                  2016-8-7 深圳 南山平山村 曾剑锋*************************************************************************************/一、参考文档:ubuntu 14.04安装nginx+php+mysqlhttp://www.cnblogs.com/helinfeng/p/4219051.html

二、目录结构:root@aplex:/home/aplex/website/phpsite# pwd/home/aplex/website/phpsiteroot@aplex:/home/aplex/website/phpsite# tree.└── index.php0 directories, 1 fileroot@aplex:/home/aplex/website/phpsite# 三、nginx配置:root@aplex:/etc/nginx# pwd/etc/nginxroot@aplex:/etc/nginx# lsconf.d          mime.types           nginx.conf       sites-enabledfastcgi_params  naxsi_core.rules     proxy_params     uwsgi_paramskoi-utf         naxsi.rules          scgi_params      win-utfkoi-win         naxsi-ui.conf.1.4.1  sites-availableroot@aplex:/etc/nginx# cat sites-available/default# You may add here your# server {#   ...# }# statements for each of your virtual hosts to this file### You should look at the following URL's in order to grasp a solid understanding# of Nginx configuration files in order to fully unleash the power of Nginx.# http://wiki.nginx.org/Pitfalls# http://wiki.nginx.org/QuickStart# http://wiki.nginx.org/Configuration
    ## Generally, you will want to move this file somewhere, and start with a clean# file but keep this around for reference. Or just disable in sites-enabled.## Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.##server {listen 80 default_server;listen [::]:80 default_server ipv6only=on;root /home/aplex/website/mysite;index index.html index.htm;# Make site accessible from http://localhost/
        server_name localhost;location / {# First attempt to serve request as file, then# as directory, then fall back to displaying a 404.# try_files $uri $uri/ =404;include  uwsgi_params;uwsgi_pass  127.0.0.1:9091;              #必须和uwsgi中的设置一致# Uncomment to enable naxsi on this location# include /etc/nginx/naxsi.rules}# Only for nginx-naxsi used with nginx-naxsi-ui : process denied requests#location /RequestDenied {#   proxy_pass http://127.0.0.1:8080;    
        #}#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;#}# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000##location ~ \.php$ {#   fastcgi_split_path_info ^(.+\.php)(/.+)$;#   # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini##   # With php5-cgi alone:#   fastcgi_pass 127.0.0.1:9000;#   # With php5-fpm:#   fastcgi_pass unix:/var/run/php5-fpm.sock;#   fastcgi_index index.php;#   include fastcgi_params;#}# deny access to .htaccess files, if Apache's document root# concurs with nginx's one
        ##location ~ /\.ht {#   deny all;#}}# another virtual host using mix of IP-, name-, and port-based configuration##server {#   listen 8000;#   listen somename:8080;#   server_name somename alias another.alias;#   root html;#   index index.html index.htm;##   location / {#       try_files $uri $uri/ =404;#   }#}# HTTPS server##server {#   listen 443;#   server_name localhost;##   root html;#   index index.html index.htm;##   ssl on;#   ssl_certificate cert.pem;#   ssl_certificate_key cert.key;##   ssl_session_timeout 5m;##   ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;#   ssl_ciphers "HIGH:!aNULL:!MD5 or HIGH:!aNULL:!MD5:!3DES";#   ssl_prefer_server_ciphers on;##   location / {#       try_files $uri $uri/ =404;#   }#}server {listen 8000 default_server;listen [::]:8000 default_server ipv6only=on;root /home/aplex/website/phpsite;index index.html index.htm index.php;# Make site accessible from http://localhost/
        server_name localhost;# location / {#   # First attempt to serve request as file, then#   # as directory, then fall back to displaying a 404.#   # try_files $uri $uri/ =404;#   # include  uwsgi_params;#       # uwsgi_pass  127.0.0.1:9091;              #   # Uncomment to enable naxsi on this location#   # include /etc/nginx/naxsi.rules# }# Only for nginx-naxsi used with nginx-naxsi-ui : process denied requests#location /RequestDenied {#   proxy_pass http://127.0.0.1:8080;    
        #}#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;#}# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000#location ~ \.php$ {fastcgi_split_path_info ^(.+\.php)(/.+)$;#   # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini##   # With php5-cgi alone:#   fastcgi_pass 127.0.0.1:9000;#   # With php5-fpm:fastcgi_pass unix:/var/run/php5-fpm.sock;fastcgi_index index.php;include fastcgi_params;}# deny access to .htaccess files, if Apache's document root# concurs with nginx's one
        ##location ~ /\.ht {#   deny all;#}}root@aplex:/etc/nginx# 

 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/293409.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

.NET+Sqlite如何支持加密

点击上方蓝字关注我们.NETSqlite如何支持加密SqliteSQLite 来源于公共领域 SQLite Is Public Domain、确保代码不会受到任何专有或许可内容的污染,没有任何来自互联网上的未知来源复制。即全是原创的。虽然是免费的,无需许可证,可用于任何目的…

linux之scp命令

svn 删除所有的 .svn文件 find . -name .svn -type d -exec rm -fr {} \; linux之cp/scp命令+scp命令详解 名称:cp 使用权限:所有使用者 使用方式: cp [options] source dest cp [options] source... directory 说明&#xff1a…

裸奔、抽烟、凡尔赛,原来数学家玩得这么野……

全世界只有3.14 % 的人关注了爆炸吧知识六个数学家一部数学史假如宇宙真的由神明设计那他一定是个数学家数学就是他描绘自然的语言数学的重要性已经不用多说但是很多人仍觉得数学是高冷的女神其实数学神奇却并不神秘高贵却并不高冷因为有一群智者早就用他们的智慧和精力将那些晦…

SqlServer和MySQL中存储过程out返回值处理C#代码

1.SqlServer中out处理 C#代码 #region"SqlServer中存储过程处理out返回值"//public void getdata()//{// string str " server192.168.xxxx ;user idxxx;passwordxxxxx#;databasexxxxx_db;min pool size4;max pool size4;packet size3072";// SqlCo…

C#摄像头实现拍照功能的简单代码示例

C#摄像头实现拍照功能的简单代码示例2009-11-20 来自:网上整理字体大小:【大中小】摘要:这里将介绍一个C#摄像头实现拍照功能的简单代码示例,代码虽然不短,但是基本上实现了相对应的功能,希望对大家有所帮…

数据分析在零售业八大应用点总结

1、销售指标分析: 主要分析各项销售指标,例如毛利、毛利率、坪效、交叉比、销进比、盈利能力、周转率、同比、环比等等;而分析维又可从管理架构、类别品牌、日期、时段等角度观察,这些分析维又采用多级钻取,从而获得相…

foreach循环符合就不往下走了_柴油发电机组冷却液循环故障解决方法

点击上方蓝字了解更多精彩柴油发电机组冷却液循环故障是发电机组的常见故障之一!下面给大家介绍一下针对循环故障做出的排查解决。1、柴油发电机组水泵故障。首先我们要先检查水泵作用是否良好,要是发现水泵传动齿轴磨损过限时,说明水泵已失去…

java web移植 遇到Project facet Java version 1.7 is not supported

2019独角兽企业重金招聘Python工程师标准>>> 在移植eclipse项目时,如果遇到 “Project facet Java version 1.7 is not supported.” 项目中的jdk1.7不支持。说明项目是其他版本jdk编译的,在eclipse里运行时会报版本不支持。 解决办法: 法1&a…

c#winform自定义窗体(含源码)

第一步:首先引用DLL再窗体中继承DevComponents.DotNetBar.OfficeFormpublic partial class MainForm : DevComponents.DotNetBar.OfficeForm初始化程序中添加 this.EnableGlass false;public MainForm(){this.EnableGlass false;InitializeComponent();}第二步&a…

linux之tmp文件夹

最近开始学习LINUX,关于/tmp文件夹, 查了些资料,/tmp文件夹是存放linux临时文件的地方,在Linux系统中/tmp文件夹里面的文件会被清空,至于多长时间被清空,如何清空的,可能就不清除了。 在CentOS5…

如何巧妙拒绝老同学借钱?哈哈哈哈哈......

1 别说,还挺像...cr:豆瓣银河系漫游1999▼2 奇奇怪怪的赚钱方式又增加了▼3 教你如何做到边吃边睡...▼4 方法二还挺有道理...▼5 总是在不该清醒的时候清醒▼6 多令人怀念!▼7 对不起,我太菜了▼8 哈哈哈哈哈▼8 数学能有…

协同过滤

在现今的推荐技术和算法中,最被大家广泛认可和采用的就是基于协同过滤的推荐方法。本文将带你深入了解协同过滤的秘密。 1 什么是协同过滤 协同过滤是利用集体智慧的一个典型方法。要理解什么是协同过滤 (Collaborative Filtering, 简称 CF),首先想一个简…

移动平台对 meta 标签的定义

下面介绍一些有关标记的例子及解释。 一、meta 标签分两大部分:HTTP 标题信息(http-equiv)和页面描述信息(name)。 1、http-equiv 属性的 Content-Type 值(显示字符集的设定) 说明:设…

微信改成右滑删除_手机文件数据恢复,怎样恢复已过期的微信附件呢?

手机文件数据恢复,怎样恢复已过期的微信附件呢?我们在恢复手机删除的文件之前,很多人都想知道,为什么自己的文件删除了可以被恢复,既然能被恢复,是我彻底删除不了手机的文件吗?文件真的消失了吗…

linux之cat命令详解

简略版: cat主要有三大功能: 1.一次显示整个文件。$ cat filename 2.从键盘创建一个文件。$ cat > filename 只能创建新文件,不能编辑已有文件. 3.将几个文件合并为一个文件: $cat file1 file2 > file参数: -n 或 --nu…

【.NET 遇上 GraphQL】使用 Hot Chocolate 构建 GraphQL 服务

Hot Chocolate 是 .NET 平台下的一个开源组件库, 您可以使用它创建 GraphQL 服务, 它消除了构建成熟的 GraphQL 服务的复杂性, Hot Chocolate 可以连接任何服务或数据源,并创建一个有凝聚力的服务,为您的消费者提供统一的 API。在本文中, 我会在 .NET 应…

POJ2184 Cow Exhibition(DP:变种01背包)

题意: 一群奶牛分别有s和f两个值,要求选出一些奶牛使s与f的和最大并且s和f分别的和不能为负数。 要点: 用dp[i]j表示当s的和为i时f的和为j,这样最后只要求dp[i]i的最大值即可。注意这题因为有负数,所以引入一个偏移量。…

PHP命令注入***

PHP命令注入***漏洞是PHP应用程序中常见的脚本漏洞之一,国内著名的Web应用程序Discuz!、DedeCMS等都曾经存在过该类型漏洞。本文描述了常见的PHP命令注入***漏洞存在形式和利用方法,结合漏洞实例进行分析和漏洞利用,并针对如何防范PHP命令注入…

Vim文本编辑器 指令大全(二)

经常处理文本以及经常需要写代码的人,都会有自己比较常用的编辑器,本人喜欢用Vim,理由就是Vim编辑器灵活,并且可以达到纯键盘操作,使用纯熟情况下,根本不需要鼠标操作,听起来是不是很酷的&#…