Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When refreshing the homepage, if the client carries "If Modified -", a 403 error will be triggered #63

Open
tossp opened this issue Aug 2, 2023 · 1 comment · May be fixed by #69
Open

Comments

@tossp
Copy link

tossp commented Aug 2, 2023

Aug 02 15:34:06 mc-tx caddy[2432909]: {"level":"debug","ts":1690961646.5239983,"logger":"http.handlers.s3proxy","msg":"get from S3","bucket":"static","key":"/wx_sj9_web/index.html"}
Aug 02 15:34:06 mc-tx caddy[2432909]: {"level":"debug","ts":1690961646.5725636,"logger":"http.log.error","msg":"can not view a directory","request":{"remote_ip":"118.x.x.x","remote_port":"62536","proto":"HTTP/3.0","method":"GET","host":"swxb.xxx","uri":"/","headers":{"Sec-Fetch-Mode":["navigate"],"Sec-Ch-Ua-Mobile":["?0"],"Upgrade-Insecure-Requests":["1"],"Sec-Fetch-Dest":["document"],"Accept-Encoding":["gzip, deflate, br"],"If-Modified-Since":["Wed, 02 Aug 2023 07:27:02 GMT"],"Sec-Ch-Ua-Platform":["\"Windows\""],"Sec-Fetch-Site":["none"],"Sec-Fetch-User":["?1"],"If-None-Match":["\"bdfba442eeb67438a552cbdf0a2fa8dd\""],"User-Agent":["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36"],"Sec-Ch-Ua":["\"Not/A)Brand\";v=\"99\", \"Google Chrome\";v=\"115\", \"Chromium\";v=\"115\""],"Dnt":["1"],"Accept":["text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7"],"Accept-Language":["zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7"],"Cache-Control":["max-age=0"]},"tls":{"resumed":true,"version":772,"cipher_suite":4865,"proto":"h3","server_name":"swxb.xxx"}},"duration":0.048614851,"status":403,"err_id":"x31z70mb4","err_trace":"caddy-s3-proxy.S3Proxy.GetHandler (s3proxy.go:479)"}
@jpetrucciani jpetrucciani linked a pull request Apr 29, 2024 that will close this issue
@tandav
Copy link

tandav commented Jul 29, 2024

Same here, issue still exists. Here's a workaround that fixes it by deleting the headers from the request:

s3.example.com {
	request_header -If-Modified-Since
	request_header -If-None-Match
	route {
		s3proxy {
			endpoint http://localhost:9000/
			region dummy
			bucket files
			force_path_style
		}
	}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants