nginx代理 minio

## 客户端
upstream minio {
        ##minio服务器1,权重越高被分配到的几率越大
        server 192.168.0.37:9001 weight=1;
        ##minio服务器2
        server 192.168.0.38:9001 weight=1;
        ##minio服务器3
        server 192.168.0.39:9001 weight=1;
 }
 server{
    listen       9001;
    server_name  localhost;
    location / {
            proxy_pass http://minio;
            # 添加websocket支持
            proxy_http_version      1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
            proxy_next_upstream     http_500 http_502 http_503 http_504 error timeout invalid_header;
            proxy_set_header        Host  $http_host;
            proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
    }
 }
 # 客户端请求服务器最大允许大小-不限(文件大小)
 client_max_body_size 0; 
 ## 服务端
 upstream minioServer {
        ##minio服务器1,权重越高被分配到的几率越大
        server 192.168.0.37:9000 weight=1;
        ##minio服务器2
        server 192.168.0.38:9000 weight=1;
        ##minio服务器3
        server 192.168.0.39:9000 weight=1;
 }
 server{
    listen       9000;
    server_name  localhost;
    location / {
            proxy_pass http://minioServer;
            # 添加websocket支持
            proxy_http_version      1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
            proxy_next_upstream     http_500 http_502 http_503 http_504 error timeout invalid_header;
            proxy_set_header        Host  $http_host;
            proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
    }
 }
 
版权声明 ▶ 本网站名称:我的学习笔记
▶ 本文链接:https://ooolo.net/article/504.html
▶ 本网站的文章部分内容可能来源于网络,仅供大家学习与参考,如有侵权,请联系站长进行核实删除。
▶ 转载本站文章需要遵守:商业转载请联系站长,非商业转载请注明出处!!!

none
最后修改于:2024年05月17日 13:46

仅有一条评论

  1. 这篇文章写得深入浅出,让我这个小白也看懂了!

添加新评论

icon_mrgreen.pngicon_neutral.pngicon_twisted.pngicon_arrow.pngicon_eek.pngicon_smile.pngicon_confused.pngicon_cool.pngicon_evil.pngicon_biggrin.pngicon_idea.pngicon_redface.pngicon_razz.pngicon_rolleyes.pngicon_wink.pngicon_cry.pngicon_surprised.pngicon_lol.pngicon_mad.pngicon_sad.pngicon_exclaim.pngicon_question.png