Http 302 Nginx、Minio和Traefik 2的重定向错误
我正在尝试使用Minio和Nginx为静态站点提供服务,其中路由由traefik2处理。当我进行简单的转发时,如:Http 302 Nginx、Minio和Traefik 2的重定向错误,http,nginx,minio,Http,Nginx,Minio,我正在尝试使用Minio和Nginx为静态站点提供服务,其中路由由traefik2处理。当我进行简单的转发时,如: events { } http { proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=blog_cache:10m max_size=1g inactive=1d use_temp_path=off; server { server_name unexpectedeof.xyz www.unexp
events {
}
http {
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=blog_cache:10m max_size=1g inactive=1d use_temp_path=off;
server {
server_name unexpectedeof.xyz www.unexpectedeof.xyz blog.unexpectedeof.xyz;
index index.html;
location / {
limit_except GET {
deny all;
}
proxy_hide_header "X-AMZ-Bucket-Region";
proxy_hide_header "X-AMZ-Request-Id";
proxy_cache blog_cache;
proxy_cache_valid 200 1h;
proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504;
proxy_cache_revalidate on;
proxy_cache_lock on;
add_header X-Proxy-Cache $upstream_cache_status;
proxy_pass http://minio.unexpectedeof.xyz;
}
}
}
这是可行的,但我想保留原始主机,并转向基于bucket的路由。为了做到这一点,我尝试使用minio中的示例,但是我得到了一个302
太多的重定向
server {
server_name unexpectedeof.xyz www.unexpectedeof.xyz blog.unexpectedeof.xyz;
# To allow special characters in headers
ignore_invalid_headers off;
# Allow any size file to be uploaded.
# Set to a value such as 1000m; to restrict file size to a specific value
client_max_body_size 50m;
# To disable buffering
proxy_buffering off;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_connect_timeout 300;
# Default is HTTP/1, keepalive is only enabled in HTTP/1.1
proxy_http_version 1.1;
proxy_set_header Connection "";
chunked_transfer_encoding off;
proxy_pass http://minio.unexpectedeof.xyz; # If you are using docker-compose this would be the hostname i.e. minio
# Health Check endpoint might go here. See https://www.nginx.com/resources/wiki/modules/healthcheck/
# /minio/health/live;
}
}
对我遗漏的东西有什么建议吗