Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/amazon-s3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Nginx服务器端口80上的多个S3站点_Nginx_Amazon S3_Nginx Config - Fatal编程技术网

Nginx服务器端口80上的多个S3站点

Nginx服务器端口80上的多个S3站点,nginx,amazon-s3,nginx-config,Nginx,Amazon S3,Nginx Config,我想通过nginx提供s3文件。单个子域与以下/etc/nginx/conf.d/dev.conf server { listen 80; listen [::]:80; server_name dev.domain.net; location / { proxy_set_header Host 'dev.domain.net.s3.amazonaws.com'; proxy_set_he

我想通过nginx提供s3文件。单个子域与以下
/etc/nginx/conf.d/dev.conf

server {
    listen         80;
    listen         [::]:80;
    server_name    dev.domain.net;

    location / {
         proxy_set_header Host 'dev.domain.net.s3.amazonaws.com';
         proxy_set_header Authorization '';
         proxy_hide_header x-amz-id-2;
         proxy_hide_header x-amz-request-id;
         proxy_hide_header Set-Cookie;
         proxy_ignore_headers "Set-Cookie";
         proxy_intercept_errors on;
         proxy_pass http://dev.domain.net.s3.amazonaws.com/;
         log_not_found off;
    }
}
server {
    listen         80;
    listen         [::]:80;
    server_name    qa.domain.net;

    location / {
         proxy_set_header Host 'qa.domain.net.s3.amazonaws.com';
         proxy_set_header Authorization '';
         proxy_hide_header x-amz-id-2;
         proxy_hide_header x-amz-request-id;
         proxy_hide_header Set-Cookie;
         proxy_ignore_headers "Set-Cookie";
         proxy_intercept_errors on;
         proxy_pass http://qa.domain.net.s3.amazonaws.com/;
         log_not_found off;
    }
}
还希望第二个子域
qa.domain.net
从同一个Nginx实例工作,因此添加了
/etc/Nginx/conf.d/qa.conf

server {
    listen         80;
    listen         [::]:80;
    server_name    dev.domain.net;

    location / {
         proxy_set_header Host 'dev.domain.net.s3.amazonaws.com';
         proxy_set_header Authorization '';
         proxy_hide_header x-amz-id-2;
         proxy_hide_header x-amz-request-id;
         proxy_hide_header Set-Cookie;
         proxy_ignore_headers "Set-Cookie";
         proxy_intercept_errors on;
         proxy_pass http://dev.domain.net.s3.amazonaws.com/;
         log_not_found off;
    }
}
server {
    listen         80;
    listen         [::]:80;
    server_name    qa.domain.net;

    location / {
         proxy_set_header Host 'qa.domain.net.s3.amazonaws.com';
         proxy_set_header Authorization '';
         proxy_hide_header x-amz-id-2;
         proxy_hide_header x-amz-request-id;
         proxy_hide_header Set-Cookie;
         proxy_ignore_headers "Set-Cookie";
         proxy_intercept_errors on;
         proxy_pass http://qa.domain.net.s3.amazonaws.com/;
         log_not_found off;
    }
}

但是当我尝试访问
qa.domain.net
时,我得到了
dev.domain.net
。我需要在这里做什么?

假设执行
nginx-t
显示没有问题,并且您执行了
重新加载
重新启动
是,配置正确并且重新加载/重新启动。假设执行
nginx-t
显示没有问题,并且您执行了
重新加载
重新启动
是,配置正确并且重新加载/重新启动。