一、配置

#vi /usr/local/nginx/conf/vhost/test.com.conf

写入:

server

{

listen 80;

server_name test.com test1.com test2.com;

index index.html index.htm index.php;

root /data/nginx/test.com;

if ($host != 'test.com' ) {

rewrite ^/(.*)$ http://test.com/$1 permanent;

}

location ~ \.php$

{

include fastcgi_params;

fastcgi_pass unix:/tmp/php-fcgi.sock;

fastcgi_index index.php;

fastcgi_param SCRIPT_FILENAME /data/nginx/test.com$fastcgi_script_name;

}

access_log /tmp/1.log combined_realip;

}

//fastcgi_pass用来指定php-fpm的地址

# vim /data/nginx/test.com/3.php

写入:

<?php

phpinfo();

?>

# curl -x

curl -x192.168.244.128:80 test.com/3.php

test.com/3.php

写入:

<?php

phpinfo();

?>

重新加载nginx

# /usr/local/nginx/sbin/nginx -t

# /usr/local/nginx/sbin/nginx -s reload

# curl -x192.168.244.128:80 test.com/3.php

LNMP配置——Nginx配置 —— Nginx解析PHP的更多相关文章

  1. LNMP环境搭建:Nginx安装、测试与域名配置

    Nginx作为一款优秀的Web Server软件同时也是一款优秀的负载均衡或前端反向代理.缓存服务软件 2.编译安装Nginx (1)安装Nginx依赖函数库pcre pcre为“perl兼容正则表达 ...

  2. 09 . Nginx配置LNMP和LNMT架构

    安装LNMP架构 环境清单 list CentOS7.3 proxysql-2.0.12-1-centos7.x86_64.rpm mysql-5.7.23-1.el7.x86_64.rpm-bund ...

  3. 【转】【Nginx】Nginx 入门教程 + 常用配置解析

    == Nginx介绍和安装 == Nginx是一个自由.开源.高性能及轻量级的HTTP服务器及反转代理服务器, 其性能与IMAP/POP3代理服务器相当.Nginx以其高性能.稳定.功能丰富.配置简单 ...

  4. 初识nginx——配置解析篇

    一.nginx的介绍 nginx是由俄罗斯人开发的一款高性能的http和反向代理服务器,也可以用来作为邮件代理.相比较于其他的服务器,具有占用内存少,稳定性高等优势 二.nginx的配置 nginx的 ...

  5. Nginx 配置解析

    概述:本篇文章主要对Nginx配置文件中一些常用配置进行了讲解,和如何使用Docker进行安装Nginx.因为该文章是回首在工作闲暇之余整理的,还有待完善,如果有疑义和更好的建议的朋友可以留言给我. ...

  6. Nginx配置解析

    #运行用户,默认即是nginx,可不设置 #user nobody; #nginx进程,一般设置为和cpu核数一样 worker_processes 1; #;单个后台worker process进程 ...

  7. nginx 配置 https 并强制跳转(lnmp一键安装包)

    目录 一.安装包 二.配置 三.查看配置文件 3.1.设定强制跳转 https 3.2 Rewrite 常用全局变量举例 一.安装包 安装大家按照官方说的安装即可. ./install.sh lnmp ...

  8. Linux配置LNMP环境(一)配置Nginx

    注意:配置版本nginx-1.12.0,使用虚拟机安装linux.教程中的下载地址可能有变化.注意(在您看本教程之前首先需要对linux的基本操作熟悉) 1.  先cd到/usr/local/src ...

  9. lnmp之Nginx配置https加密访问

    配置lnmp之Nginx网站支持https加密访问 注: 1. 这里拿购买的(pxsnx.pxjy.com)证书来做样例 证书文件共有三个---> (pxsnxg.pxjy.com_ca.crt ...

随机推荐

  1. 4.安装fluentd用于收集集群内部应用日志

    作者 微信:tangy8080 电子邮箱:914661180@qq.com 更新时间:2019-06-13 11:02:14 星期四 欢迎您订阅和分享我的订阅号,订阅号内会不定期分享一些我自己学习过程 ...

  2. 按层次顺序创建二叉树;判断BST

    https://github.com/TouwaErioH/subjects/tree/master/C%2B%2B/PA2 BST 假设已经给定树节点的结构不可修改. 然后输入是按照层次顺序 怎样创 ...

  3. codeforces 1037E-Trips 【构造】

    题目:戳这里 题意:n个点,每天早上会在这n个点中加一条边,每天晚上最大的子图满足子图中每个点都有k条或以上的边. 解题思路:看了官方题解,先把所有的点都连上,再从最后一天往前减边,用set维护最大的 ...

  4. js code review

    js code review https://codereview.stackexchange.com/ refs xgqfrms 2012-2020 www.cnblogs.com 发布文章使用:只 ...

  5. vue slot nested bug

    vue slot nested bug slot name bug Error <slot name="global-system-guide-slot"></s ...

  6. Flutter CLI commands All In One

    Flutter CLI commands All In One Flutter run key commands. r Hot reload. R Hot restart. h Repeat this ...

  7. github & coding 2018

    github & coding 2018 github & coding all in one https://github.com/topics/javascript react r ...

  8. Alexa website ranking

    Alexa website ranking The top 500 sites on the web https://www.alexa.com/topsites https://www.alexa. ...

  9. 时间轴 timeline

    时间轴 timeline https://www.helloweba.net/javascript/285.html https://www.helloweba.net/demo/v_timeline ...

  10. vue & dynamic components

    vue & dynamic components https://vuejs.org/v2/guide/components-dynamic-async.html keep-alive htt ...