一、配置

#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. 一、Jmeter进行Mysql数据库的压测

    1.首先需要安装配置mysql数据库连接驱动:mysql-connector-java-5.1.28.jar 1.1 网上很多资源,可自行下载: 1.2 下载完成后,分别将该jra包,存放到:jmet ...

  2. dll的注册与反注册

    regsvr32.exe是32位系统下使用的DLL注册和反注册工具,使用它必须通过命令行的方式使用,格式是:regsvr32 [/i[:cmdline]] DLL文件名命令可以在"开始→运行 ...

  3. 7.Topic交换机之模拟文件分类

    标题 : 7.Topic交换机之模拟文件分类 目录 : RabbitMQ 序号 : 7 Password = "123456", AutomaticRecoveryEnabled ...

  4. os-hackNOS-2(wp5.3本地文件包含 rbash绕过)

    一.信息收集 直接netdiscover,找到IP是 192.168.56.101 然后端口扫描一波 只打开了22和80端口,访问一下80端口,是apache首页,那就继续查目录赛.,发现了一个tsw ...

  5. what's the difference amount of pdf, epub, and mobi format

    what's the difference amount of pdf, epub, and Mobi format What is the difference between pdf, epub ...

  6. Smashing Conf 2020

    Smashing Conf 2020 https://smashingconf.com/online-workshops/ events https://smashingconf.com/ny-202 ...

  7. DevOps tools

    DevOps tools mozart & ansible https://www.ansible.com/integrations/devops-tools websocket jenken ...

  8. API protocols All In One

    API protocols All In One SOAP vs. REST vs. JSON-RPC vs. gRPC vs. GraphQL vs. Thrift https://www.mert ...

  9. moment.js & convert timestamps to date string in js

    moment.js & convert timestamps to date string in js https://momentjs.com/ moment().format('YYYY- ...

  10. vue的filter用法,检索内容

    var app5 = new Vue({ el: '#app5', data: { shoppingList: [ "Milk", "Donuts", &quo ...