zoukankan      html  css  js  c++  java
  • ceph 搭建nginx负载3个对象网关

    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
    

  • 相关阅读:
    71)PHP,使用cookie的语法问题
    70)PHP,cookie的安全传输和HTTPonly
    69)PHP,cookie的有效域
    68)PHP,cookie的详细属性和有效期
    C#中的internal关键字
    C# 中如何将一个类文件(XX.CS)封装成.dll文件
    c# 委托和事件(总结篇)
    c#事件实例三
    c#事件实例二
    c#事件实例一
  • 原文地址:https://www.cnblogs.com/kuku0223/p/8251459.html
Copyright © 2011-2022 走看看