I have a simple configuration file that is used for server page 503 errors during maintenance. The relevant part is as follows:
server { listen 80 default; root /usr/share/nginx/html; server_name example.com; location / { if (-f $document_root/503.json) { return 503; } }
The problem is that Nginx finds out that any request is allowed in a static file, and any POST, PUT and DELETE requests receive a 405 response (method not allowed).
So the question is: how can I tell Nginx to serve my page for any HTTP method?
source share