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 ...
随机推荐
- C#基础知识之三
C#基础知识之三 1. 程序集间的继承:基类必须被声明为public.必须在project中包含对该基类的程序集引用. 2. 对其它程序集引用和添加对using指令的差别:前者是告诉编译器所需的类 ...
- ABAP制作密码输入框
[转自 http://blog.csdn.net/saphome/article/details/6956911] 这几天做一个系统维护的程序,需要用户输入用户名和密码登录.可怎样实现输入密码显示星号 ...
- eclispse + tomcat 启动是不加载项目的解决办法
有一个java spring的项目一直好好的,突然一天不能启动了.eclipse的console没有报任何错误,相关的server配置也没有问题,经过一翻折腾顺便还把eclipse从indigo升级到 ...
- matlab常用的一些程序和功能
~ 去除误匹配算法(matlab) 1.ransac算法 [tform,matchedPoints1,matchedPoints2] = ... estimateGeometricTransfo ...
- 如何写PHP规范注释
所有的文档标记都是在每一行的 * 后面以@开头.如果在一段话的中间出来@的标记,这个标记将会被当做普通内容而被忽略掉. @access 该标记用于指明关键字的存取权限:private.p ...
- html 文本输入框效果大汇集
html 文本输入框效果大汇集 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 ...
- Example 2 - contour plots
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" begin cdf_file = addfile("$N ...
- python用特殊方法定制类(不全)
定义在class中不需要直接调用,python的某些函数或操作符会自动的调用对应的特殊方法. 1.python中 __str__和__repr__ __str__()用于显示给用户,而__repr__ ...
- codeforces 60B bfs
题意:给出一个六面体分为k层,每层n行m列,每个小立方体有'.'(空)与'#'(障碍)的状态,第一层某个空的位置有一个水龙头,水流每次往六个方向流动(...).最少时间水流能把立方体空的部分填满. 思 ...
- SQL Server convet函数data_type默认长度
语法 CONVERT(data_type(length),data_to_be_converted,style) data_type(length) 规定目标数据类型(带有可选的长度),默认30个字符 ...