mirror of
https://github.com/cubefs/cubefs.git
synced 2026-08-02 02:00:56 +00:00
Refactor: using path style when signurl by console
Signed-off-by: Mofei Zhang <mofei2816@gmail.com>
This commit is contained in:
parent
98f072cba5
commit
5ff0c87859
@ -4,6 +4,11 @@ import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/credentials"
|
||||
"github.com/aws/aws-sdk-go/aws/session"
|
||||
@ -16,10 +21,6 @@ import (
|
||||
"github.com/chubaofs/chubaofs/util/log"
|
||||
"github.com/samsarahq/thunder/graphql"
|
||||
"github.com/samsarahq/thunder/graphql/schemabuilder"
|
||||
"net/http"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
type FileService struct {
|
||||
@ -271,6 +272,7 @@ func (fs *FileService) signURL(ctx context.Context, args struct {
|
||||
ac.DisableSSL = aws.Bool(true)
|
||||
ac.Region = aws.String("default")
|
||||
ac.Credentials = credentials.NewStaticCredentials(userInfo.Access_key, userInfo.Secret_key, "")
|
||||
ac.S3ForcePathStyle = aws.Bool(true)
|
||||
s3Svc := s3.New(sess, ac)
|
||||
request, _ := s3Svc.GetObjectRequest(&s3.GetObjectInput{
|
||||
Bucket: aws.String(args.VolName),
|
||||
|
||||
@ -43,6 +43,10 @@ http {
|
||||
server 192.168.0.43:80;
|
||||
}
|
||||
|
||||
upstream consoles {
|
||||
server 192.168.0.50:80;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name object.chubao.io ~^(?<bucket>.+)\.object\.chubao\.io$;
|
||||
@ -64,11 +68,11 @@ http {
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name console.chubao.io ~^(?<bucket>.+)\.console\.chubao\.io$;
|
||||
server_name console.chubao.io;
|
||||
charset utf-8;
|
||||
|
||||
location / {
|
||||
proxy_pass http://192.168.0.50:80;
|
||||
proxy_pass http://consoles;
|
||||
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $http_host;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user