nginx.conf

user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid; # Load dynamic modules. See /usr/share/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf; events {
worker_connections 1024;
} http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
# Load modular configuration files from the /etc/nginx/conf.d directory.
# See http://nginx.org/en/docs/ngx_core_module.html#include
# for more information.
include /etc/nginx/conf.d/*.conf;
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name cephcloud.com; # Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
if ($host ~* (.*)\.cephcloud\.com$){
set $sub_dom '$1';
rewrite ^(.*)$ /$sub_dom$1 last;
}
location /{

              proxy_set_header Host $host;
              proxy_set_header X-Forwarded-For $remote_addr;
              proxy_set_header X-Forwarded-Host $server_name;
              proxy_set_header X-Real-IP $remote_addr;

                        proxy_pass http://ceph_radosgw_zone;
}
}
}

upstream.conf

upstream ceph_radosgw_zone {
server mon-node1:7480 weight=1 max_fails=2 fail_timeout=5;
server mon-node2:7480 weight=1 max_fails=2 fail_timeout=5;
server mon-node3:7480 weight=1 max_fails=2 fail_timeout=5;
}

/etc/hosts

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
10.101.0.102 admin-node cephcloud.com
10.101.0.95 mon-node1
10.101.0.96 mon-node2
10.101.0.97 mon-node3
10.101.0.98 data-node1
10.101.0.99 data-node2
10.101.0.100 data-node3
127.0.0.1 cephcloud.com

ceph 搭建nginx负载3个对象网关的更多相关文章

  1. Net分布式系统之二:CentOS系统搭建Nginx负载均衡

    一.关于CentOS系统介绍 CentOS(Community Enterprise Operating System,中文意思是:社区企业操作系统)是Linux发行版之一,它是来自于Red Hat ...

  2. Nginx系列一:正向代理和反向代理、Nginx工作原理、Nginx常用命令和升级、搭建Nginx负载均衡

    转自https://www.cnblogs.com/leeSmall/p/9351343.html 仅供个人学习 一.什么是正向代理.什么是反向代理 1. 正向代理,意思是一个位于客户端和原始服务器( ...

  3. docker 搭建 nginx负载均衡

    本文描述如何在一台机器上搭建nginx负载均衡,我将会启动3个nginx的docker,分别是1台前置nginx负责分发,后面2台负责处理请求. 首先我切换到/usr/local/docker/文件夹 ...

  4. Tomcat WEB搭建+Nginx负载均衡动静分离+DNS解析的实验

    实验拓扑图: 实验环境: 在VMware workstation搭建虚拟环境,利用网络适配器的Nat和桥接模式模拟内网和外网环境. 实验过程中需要安装的工具包包括:vim unzip lrzsz ls ...

  5. Nginx系列篇二:linux搭建Nginx负载均衡

    建议先搭建好Nginx环境 可阅读--->Linux中搭建Nginx 1.准备好三台服务器[标配] 一.nginx负载均衡服务器:192.168.102.110,配置好Nginx 二.tomca ...

  6. Linux搭建nginx负载均衡(两台服务器之间)

    负载均衡种类 第一种:通过硬件负载解决,常见的有NetScaler.F5.Radware和Array等商用的负载均衡器,价格比较昂贵 第二种:通过软件负载解决,常见的软件有LVS.Nginx.apac ...

  7. Linux学习10-CentOS搭建nginx负载均衡环境

    前言 当自己的web网站访问的人越来越多,一台服务器无法满足现有的业务时,此时会想到多加几台服务器来实现负载均衡. 网站的访问量越来越大,服务器的服务模式也得进行相应的升级,怎样将同一个域名的访问分散 ...

  8. Net分布式系统之二:CentOS系统搭建Nginx负载均衡(下)

    上一篇文章介绍了VMWare12虚拟机.Linux(CentOS7)系统安装.部署Nginx1.6.3代理服务做负载均衡.接下来介绍通过Nginx将请求分发到各web应用处理服务. 一.Web应用开发 ...

  9. windows下搭建nginx负载均衡

    学习笔记,第一次记录避免忘记 首先介绍一下本地环境是windows2008 R2-64位. 1.  到nginx官网上下载最新稳定版的安装包,http://nginx.org/en/download. ...

随机推荐

  1. Android学习之基础知识四-Activity活动5讲(Activity的生命周期)

    一.返回栈 1.Android是通过任务(Task)来管理活动,一个任务就是一个返回栈内所有活动的集合. 2.返回栈是一个后进先出的数据结构,每启动一个新的活动,该活动就会覆盖原来的活动,位于栈顶位置 ...

  2. linxu自定义安装及网络配置

    1.VMware及Centos6下载 链接:https://pan.baidu.com/s/1XMgBXA13e2zovijhcyciIA   提取码:5sqg 2.安装VMware:略 3.安装虚拟 ...

  3. 云主机被拿去挖矿,cpu暴涨,tcp连接突增

    1.云主机被拿去挖矿,cpu暴涨,tcp连接突增 2.现象:top -c 3.然后我再查看pstree进程树 4.查找文件来源 ind  / -name '*suppoie*' 5. 然后删除 sup ...

  4. 【转】Java生成图片验证码

    原文转自:http://blog.csdn.net/ruixue0117/article/details/22829557 看了挺多图片验证码的代码,感觉没什么长的好看点的,就自己动手写了个,写完发现 ...

  5. 新页面,简单的tree视图写法

    .xml文件 <?xml version="1.0"?><openerp> <data> <!--Tree view--> < ...

  6. OpenStack报错:MessagingTimeout: Timed out waiting for a reply to message ID

    L3.agent中出现大量消息超时错误,对网络的操作各种异常. 报错如下: -- :: ERROR neutron.agent.l3.agent [req-db9207e6--4f23-8c19-0d ...

  7. CF11D A Simple Task 状压DP

    传送门 \(N \leq 19\)-- 不难想到一个状压:设\(f_{i,j,k}\)表示开头为\(i\).结尾为\(j\).经过的点数二进制下为\(k\)的简单路总数,贡献答案就看\(i,j\)之间 ...

  8. 使用第三方库(Senparc)完成小程序支付 - z

    https://www.cnblogs.com/zmaiwxl/p/8931585.html

  9. WPF CheckBox 滑块 样式 开关

    原文:WPF CheckBox 滑块 样式 开关 效果图 样式代码 <Style x:Key="CheckRadioFocusVisual"> <Setter P ...

  10. [HNOI2018]游戏[拓扑排序]

    题意 题目链接 分析 先将没有锁的房间缩点,首先有一个 \(O(n^2)\) 的想法:从每个点出发,每次检查能否向两边扩张. 容易发现门和门之间如果有锁,必然只有一方能够开锁(只有一把钥匙),并且能够 ...