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 ...
随机推荐
- 转。git 乌龟的使用安装
TortoiseGit 简称 tgit, 中文名海龟Git. 海龟Git只支持神器 Windows 系统, 有一个前辈海龟SVN, TortoiseSVN和TortoiseGit都是非常优秀的开源的版 ...
- vim vimdiff diff 使用及命令
vim: vim 从 vim7 开始加入了多标签切换的功能, 相当于多窗口. 之前的版本虽然也有多文件编辑功能, 但是总之不如这个方便啦.用法::tabnew [++opt选项] [+cmd] 文件 ...
- LeetCode:移除K位数字【402】
LeetCode:移除K位数字[402] 题目描述 给定一个以字符串表示的非负整数 num,移除这个数中的 k 位数字,使得剩下的数字最小. 注意: num 的长度小于 10002 且 ≥ k. nu ...
- HackerRank - beautiful-binary-string 【字符串】
题意 给出一个 N 位的 01 串 然后 每次 改动 可以将其中的 (0 -> 1) 或者 (1 -> 0) 然后 求 最少几次 改动 使得 这个 01 串 当中 不存在 连续的 010 ...
- 【leetcode刷题笔记】Add Binary
Given two binary strings, return their sum (also a binary string). For example,a = "11"b = ...
- 【leetcode刷题笔记】Unique Paths II
Follow up for "Unique Paths": Now consider if some obstacles are added to the grids. How m ...
- 第五篇、css补充二
一.内容概要 1.图标 2.目录规划 3.a标签中的img标签在浏览器中的适应性 4.后台管理系统设置 5.边缘提示框 6.登录页面图标 7.静态对话框 8.加减框 补充知识: line-height ...
- java网络爬虫爬虫小栗子
简要介绍: 使用java开发的爬虫小栗子,存储到由zookeeper协调的hbase中 主要过程是模拟Post请求和get请求,html解析,hbase存储 源码:https://github.com ...
- Eclipse快捷键与Notepad++ 快捷建冲突的问题
notepad++添加了zen coding插件以后,notepad++默认的快捷键中Alt+/也是其快捷键中的一个,表示toggle comment,而用myeclipce或eclipse的朋友都知 ...
- c#学习内容
学习winform+DevExpress 界面制作 wpf UIAutomation 控制别的程序 ok c#通过句柄控制别的程序 ok c# 截图 ok c# 多线程 ok c# 数据库myq ...