vps交流

请教大佬,关于nginx反向代理配置文件


如何让

https://bucket-name.minio.example.com (path style disabled).

批量反向代理到二级目录呢

https://minio.example.com/bucket-name (path style enabled),

配置文件该怎么写呢

使用 rewrite 指令
  1. location ~ ^/二级目录/(.*) {
  2.     rewrite ^/二级目录/(.*)$ /$1;break;
  3.     proxy_pass https://xxx;
  4.     proxy_set_header Host xxx;
  5.     proxy_set_header X-Real-IP $remote_addr;
  6.     proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  7.     proxy_set_header REMOTE-HOST $remote_addr;
  8.    
  9. }

复制代码

这个试试请教大佬,关于nginx反向代理配置文件

本帖最后由 mushaofeng 于 2022-1-28 10:28 编辑

  1. location /bucket-name/ {
  2.     proxy_pass https://bucket-name.minio.example.com/;
  3.     proxy_redirect default;
  4. }

复制代码

nginx proxy_redirect

反向代理?
赞(0)
版权声明:本贴采用知识共享 署名4.0国际许可协议 [BY-NC-SA] 进行授权
帖子名称:《请教大佬,关于nginx反向代理配置文件》
帖子链接:https://bbs.toot.su/72613.html

相关推荐