nginx做代理部署WordPress
实验环境:CentOS7
服务器172.16.252.142做Nginx代理服务器:
[root@conf.d localhost]#iptables -F
[root@conf.d localhost]#setenforce 0
[root@conf.d localhost]#yum -y install nginx
[root@conf.d localhost]#cd /etc/nginx/conf.d/
[root@conf.d localhost]#vim default.conf
#静态资源和动态资源全部用一台服务器172.16.254.47,用不同的端口;
server {
listen 80;
server_name www.mylinux.io; location ~* \.(html|js|css|jpg|jpeg|png|gif)$ {
#location / {
proxy_pass http://172.16.254.47:80;
}
location ~* \.php$ {
fastcgi_pass 172.16.254.47:9000;
fastcgi_index index.php;
include fastcgi_params;
#向后端php-fpm服务器传递脚本的方式:是在fastcgi_param文件中,将变量SCRIPT_NAME向后传递,/data/apps是php-fpm的document路径
fastcgi_param SCRIPT_FILENAME /var/www/html/wordpress$fastcgi_script_name;
}
}
[root@conf.d localhost]#nginx -t
[root@conf.d localhost]#nginx -s reload
RS:172.16.254.47
[root@html localhost]#yum -y install mariadb-server php-mysql
[root@html localhost]#chown -R nginx:nginx wordpress/
[root@html localhost]#vim /etc/php-fpm.d/www.conf
listen = 172.16.254.47:9000 #监听本地地址
listen.allowed_clients = 172.16.252.142 #Nginx代理服务器的地址
[root@html localhost]#mysql -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 286
Server version: 5.5.52-MariaDB MariaDB Server Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> GRANT ALL ON wp.* TO wp@'172.16.254.47' IDENTIFIED BY '123456';
MariaDB [(none)]> CREATE DATABASE wp;
MariaDB [(none)]> FLUSH PRIVILEGES;

nginx做代理部署WordPress的更多相关文章
- nginx反向代理部署springboot项目报404无法加载静态资源
问题:nginx反向代理部署springboot项目报404无法加载静态资源(css,js,jpg,png...) springboot默认启动端口为8080,如果需要通过域名(不加端口号)直接访问s ...
- 服务器使用nginx做代理,通过HttpServletRequest获取请求用户真实IP地址
首先,在nginx配置中添加如下配置 server { listen ; server_name www.wenki.info; #要访问的域名 charset utf8; location / { ...
- nginx做代理安装docker
1.环境 服务器IP 服务用途 是否能 联网 192.168.126.128 docker服务器(简称B服务器) 不能 192.168.126.130 nginx服务器(简称A服务器) 能 2.背景 ...
- Nginx反向代理部署指南
一.反向代理 我们都知道,80端口是web服务的默认端口,其他主机访问web服务器也是默认和80端口进行web交互,而一台服务器也只有一个80端口,这是约定俗成的标准. 我们来看下面两个场景: 1.服 ...
- nginx反向代理部署vue项目(history模式)的方法
前言: 根据标题我们要区分出两个信息 1. history 模式部署 ( vue的路由模式如果使用history,刷新会报404错误.) 2. Nginx 做反向代理 问题1思考: vue-route ...
- Nginx做代理
0 查看日志 tail -f /var/log/nginx/access.log 1 Nginx代理配置语法 1.Nginx代理配置语法 Syntax: proxy_pass URL; Default ...
- asp.net Core 部署到CentOs7上,使用Nginx做代理
一.CentOs7部署Nginx 1.准备工作 Nginx的安装依赖于以下三个包,意思就是在安装Nginx之前首先必须安装一下的三个包,注意安装顺序如下: 1 SSL功能需要openssl库,直接通过 ...
- 关于nginx做代理,uwsgi gunicorn等服务器做后端时
(1) 响应数据过大 被截断的问题 通常看buffers参数的设置(缓冲从后端服务器的应答) uwsgi的参数是 uwsgi_buffers 4 128k gunicorn 设置代理参数 proxy_ ...
- Nginx反向代理部署NodeJS项目
在nginx配置文件种的http节点下: server { listen 8005; server_name localhost; location /{ proxy_set_header X_Rea ...
随机推荐
- 关于中国省市的一份js代码
下面是一份关于中国省市的js代码,搜藏起来,非常有用. var arrCity = [ { name:"请选择", sub:[{name:"请选择"}], ty ...
- amp模板展示amp网站也可以做得很好看
ytkah比较喜欢研究一些新东西,AMP刚出来的时候就上手了,也做了一些站点,而且还不赖,因为这个还机缘巧合参加了深圳的谷歌全球合作伙伴大会,很多大牛也都来了,很荣幸能和他们一起交流.下面就稍微展示一 ...
- struts2核心和工作原理
转至:http://blog.csdn.net/laner0515/article/details/27692673 在学习struts2之前,首先我们要明白使用struts2的目的是什么?它能给我们 ...
- Data Structure Graph: prim
最小生成树算法.这里的s是可以随意选取的,不影响树的生成,但是不同的s有不同的dis #include <iostream> #include <vector> #includ ...
- Data Structure Linked List: Write a function to reverse a linked list
iterative太简单不写了 http://www.geeksforgeeks.org/write-a-function-to-reverse-the-nodes-of-a-linked-list/ ...
- Example 1 - XY plots
http://www.ncl.ucar.edu/Document/Manuals/Getting_Started/Examples/gsun01n.shtml Frame 1 Frame 2 Fram ...
- leetcode 901. Online Stock Span
Write a class StockSpanner which collects daily price quotes for some stock, and returns the span of ...
- [原创]关于在CentOS 7.0 下 安装nfs ,遇见 Transaction check error问题的解决
今天小弟的同学在使用阿里云的服务器安装nfs的时候,出现了一下问题 Transaction check error: file /usr/lib/systemd/system/blk-availabi ...
- Redis的管理
一.redis持久化 redis是内存数据库,一切的数据都是存储到内存中的,我们知道,当服务器意外关机,那么在内存中的数据都将丢失,但是redis为我们提供持久化功能,这样就能把数据保存到硬盘上.re ...
- MyCat:开源分布式数据库中间件
mycat 的主要配置文件 schema.xml rule.xml server.xml 客户端连接mycat mysql -h192.168.1.1 -P8806 -uroot -pwangxiao ...