Skip to content

Commit

Permalink
gateway: support virtual-host-style requests (#4462)
Browse files Browse the repository at this point in the history
Co-authored-by: Davies Liu <[email protected]>
  • Loading branch information
zhijian-pro and davies authored Mar 9, 2024
1 parent eeac617 commit 64e7355
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cmd/gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ func cmdGateway() *cli.Command {
Name: "object-tag",
Usage: "enable object tagging api",
},
&cli.StringFlag{
Name: "domain",
Usage: "domain for virtual-host-style requests",
},
}

return &cli.Command{
Expand Down Expand Up @@ -118,6 +122,9 @@ func gateway(c *cli.Context) error {
if len(sk) < 8 {
logger.Fatalf("MINIO_ROOT_PASSWORD should be specified as an environment variable with at least 8 characters")
}
if c.IsSet("domain") {
os.Setenv("MINIO_DOMAIN", c.String("domain"))
}

metaAddr := c.Args().Get(0)
listenAddr := c.Args().Get(1)
Expand Down
1 change: 1 addition & 0 deletions docs/en/reference/command_reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,7 @@ Apart from options listed below, this command shares options with `juicefs mount
|`--multi-buckets`|use top level of directories as buckets (default: false)|
|`--keep-etag`|save the ETag for uploaded objects (default: false)|
|`--umask=022`|umask for new file and directory in octal (default: 022)|
| `--domain value`<VersionAdd>1.2</VersionAdd> |domain for virtual-host-style requests|

### `juicefs webdav` {#webdav}

Expand Down
1 change: 1 addition & 0 deletions docs/zh_cn/reference/command_reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,7 @@ juicefs gateway redis://localhost localhost:9000
|`--multi-buckets`|使用第一级目录作为存储桶 (默认:false)|
|`--keep-etag`|保留对象上传时的 ETag (默认:false)|
|`--umask=022`|新文件和新目录的 umask 的八进制格式 (默认值:022)|
| `--domain value`<VersionAdd>1.2</VersionAdd> |虚拟主机样式请求的域|

### `juicefs webdav` {#webdav}

Expand Down

0 comments on commit 64e7355

Please sign in to comment.