首页 > 系统相关 >nginx 代理 minio

nginx 代理 minio

时间:2024-10-26 15:42:17浏览次数:1  
标签:set minio header 代理 server nginx internal proxy

nginx.conf

upstream minio_s3 {
   least_conn;
   server minio-01.internal-domain.com:9000;
   server minio-02.internal-domain.com:9000;
   server minio-03.internal-domain.com:9000;
   server minio-04.internal-domain.com:9000;
}

upstream minio_console {
   least_conn;
   server minio-01.internal-domain.com:9001;
   server minio-02.internal-domain.com:9001;
   server minio-03.internal-domain.com:9001;
   server minio-04.internal-domain.com:9001;
}

server {
   listen       80;
   listen  [::]:80;
   server_name  minio.example.net;

   # Allow special characters in headers
   ignore_invalid_headers off;
   # Allow any size file to be uploaded.
   # Set to a value such as 1000m; to restrict file size to a specific value
   client_max_body_size 0;
   # Disable buffering
   proxy_buffering off;
   proxy_request_buffering off;

   location / {
      proxy_set_header Host $http_host;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header X-Forwarded-Proto $scheme;

      proxy_connect_timeout 300;
      # Default is HTTP/1, keepalive is only enabled in HTTP/1.1
      proxy_http_version 1.1;
      proxy_set_header Connection "";
      chunked_transfer_encoding off;

      proxy_pass https://minio_s3; # This uses the upstream directive definition to load balance
   }

   location /minio/ui/ {
      rewrite ^/minio/ui/(.*) /$1 break;
      proxy_set_header Host $http_host;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header X-Forwarded-Proto $scheme;
      proxy_set_header X-NginX-Proxy true;

      # This is necessary to pass the correct IP to be hashed
      real_ip_header X-Real-IP;

      proxy_connect_timeout 300;

      # To support websockets in MinIO versions released after January 2023
      proxy_http_version 1.1;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection "upgrade";
      # Some environments may encounter CORS errors (Kubernetes + Nginx Ingress)
      # Uncomment the following line to set the Origin request to an empty string
      # proxy_set_header Origin '';

      chunked_transfer_encoding off;

      proxy_pass https://minio_console; # This uses the upstream directive definition to load balance
   }
}

参考文档

https://min.io/docs/minio/linux/integrations/setup-nginx-proxy-with-minio.html#integrations-nginx-proxy

标签:set,minio,header,代理,server,nginx,internal,proxy
From: https://www.cnblogs.com/wangguishe/p/18504136

相关文章

  • [Nginx] 开启 gzip
    如果资源已经被压缩成Gzip格式了,Nginx不需要再次压缩。只需确保Nginx的配置正确指向这些Gzip文件,并使用gzip_static指令。如果资源不是Gzip格式,就需要全配置一下。http{ ## #GzipSettings ## gzipon;#启用gzip压缩 gzip_min_len......
  • 【服务器知识】nginx不够,那我们就试试openresty
    文章目录概述OpenResty的核心特性包括:OpenResty的工作原理:如何使用OpenResty:OpenResty勾子函数......
  • 反射、代理简单理解
    反射反射允许对成员变量,成员方法和构造方法的信息进行编程访问但是获取不是从类里面获取的,是从类的字节码(.class)文件中获取的,所以我们首先要学习如何获取类的class对象。在Java中,定义好了一个类Class,就是用来描述字节码文件的获取class对象的三种方式  1.Class.forna......
  • 全面了解 NGINX 的负载均衡算法
    NGINX提供多种负载均衡方法,以应对不同的流量分发需求。常用的算法包括:最少连接、最短时间、通用哈希、随机算法和IP哈希。这些负载均衡算法都通过独立指令来定义,每种算法都有其独特的应用场景。以下负载均衡方法(IP哈希除外)适用于HTTP、TCP和UDP上游池:轮询轮询(Ro......
  • IIS使用反向代理,解决路径包含特殊字符无法访问的问题
    环境:操作系统:WindowsServer2019IIS版本:10问题试用Nocobase的时候,遇到400BadRequest的报错。 直接访问的话,报错页面是非常常见的RuntimeError。诡异这个问题,在开发端(Windows11)的IIS中不会出现。同样的IIS版本。解决办法先说结论,时间比较赶的朋友直接试这个就可以......
  • 什么是云访问安全代理(CASB)
    云访问安全代理(CASB)是一种位于企业和云服务提供商之间的安全工具,用于监控、控制和保护企业在云环境中的数据和应用。CASB可以作为中间层,帮助企业实现对云服务的可见性、数据安全性、合规性和访问控制等管理功能。一、CASB概述云计算和云服务的广泛应用使得企业和组织能够以更......
  • 取消配置此主机上的 vSphere HA 代理时出错。要解决此问题,请将主机重新连接到 vCenter
    点选受影响主机,右键-重新配置vSphereHA,自动恢复HA......
  • MinIO上传和下载文件及文件完整性校验.
    MinIO上传和下载文件及文件完整性校验.packagecom.xuecheng.media;importcom.j256.simplemagic.ContentInfo;importcom.j256.simplemagic.ContentInfoUtil;importio.minio.*;importio.minio.errors.*;importorg.apache.commons.codec.digest.DigestUtils;importorg......
  • 两台服务器(宝塔)配置Nginx负载搭建
    什么是负载均衡负载均衡就是将负载(工作任务,访问请求)进行平衡、分摊到多个操作单元(服务器,组件)上进行执行。是解决高性能,单点故障(高可用),扩展性(水平伸缩)的终极解决方案。一、准备两天服务器搭建好Nginx1、A服务192.168.0.1 B服务192.168.0.2注意了:宝塔Nginx负载必须有一个子......
  • 宝塔可以同时安装apache和nginx
    宝塔面板是一个服务器管理软件,可以帮助用户快速、简单地管理服务器。宝塔面板支持一键安装Apache、Nginx、MySQL、PHP等,并且可以提供各种管理功能,如网站、数据库的管理等。宝塔面板不支持同时安装Apache和Nginx,因为这两个软件都是用来处理HTTP服务的,你只能选择安装其中之一。如......