Nginx代理上传到s3?

时间:2018-11-21 18:43:17

标签: amazon-web-services nginx amazon-s3 amazon-ec2

我正在使用nginx代理强制通过HTTPS进行所有通信。但是,我有一个页面(/ upload),该页面发布到/ upload-downloadable,然后使用流将用户文件上传到AWS(bucketname.s3.eu-west-1.amazonaws.com)

据我在AWS s3存储桶上看到的那样上传,但是没有响应服务器告诉用户?完全没有代理即可工作,但不能与我当前的配置一起使用。

客户端-> AWS也是如此,但AWS->服务器/客户端不起作用。

有什么想法吗?

upstream site {
    server 127.0.0.1:1337;
}

upstream project {
     server localhost:27017;
}

# HTTP — redirect all traffic to HTTPS
server {
    listen 80;
    listen [::]:80 default_server ipv6only=on;
    return 301 https://$host$request_uri;
}

# HTTPS — proxy all requests to the Node app
server {
    # Enable HTTP/2
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name tryhackme.com;

    error_page 502 /down.html;
    location /down.html {
        root /var/www/html;
    }

    #error_page 500 502 503 504 /var/www/html/down.html;

    # Use the Let’s Encrypt certificates
    ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;

    # Include the SSL configuration from cipherli.st
    include snippets/ssl-params.conf;

    location / {
        #proxy_pass http://127.0.0.1:28017;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-NginX-Proxy true;
        proxy_read_timeout 3600;
        proxy_pass http://localhost:1337/;
        proxy_ssl_session_reuse off;
        proxy_set_header Host $http_host;
        proxy_cache_bypass $http_upgrade;
        proxy_redirect off;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }
}

0 个答案:

没有答案