Nginx反向代理LAMP解析PHP环境
1.Nginx充当中介,将请求转发给其他LAMP 192.168.200.112中yum安装LAMP [root@localhost ~]# yum -y install httpd mairadb mariadb-server php php-mysql [root@localhost ~]# systemctl start httpd [root@localhost ~]# systemctl start mariadb [root@localhost ~]# vim /var/www/html/test.php //添加测试文档 192.168.200.111中安装nginx [root@localhost ~]# vim /usr/local/nginx/conf/nginx.conf //修改主配置文件,添加location location ~* \.php$ { proxy_pass http://192.168.200.112; } [root@localhost ~]# nginx -t nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok nginx: configuration file /usr/local/nginx/conf/nginx.conf