Nginx doesn't allow serving static content when responding to POST requests.
The solution first creates an HTTP 405 error for all requests (including POST requests) to a given location and then simply returns the result of a proxy pass GET request to the static resource instead of the error page.