Skip to content

Instantly share code, notes, and snippets.

@raucao
Created October 7, 2023 13:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raucao/0aa1c59a1b3902b2a7a7ff925f0c32d4 to your computer and use it in GitHub Desktop.
Save raucao/0aa1c59a1b3902b2a7a7ff925f0c32d4 to your computer and use it in GitHub Desktop.
location / {
if ($request_method = OPTIONS) {
add_header Content-Length 0;
add_header Content-Type text/plain;
return 200;
}
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_max_temp_file_size 0;
proxy_pass http://s3_backend;
header_filter_by_lua_block {
if ngx.req.get_method() == "PUT" and ngx.status == ngx.HTTP_OK then
ngx.status = ngx.HTTP_CREATED
end
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment