1

I have an Nginx server and a PHP application running in PHP-FPM. The application is restful API. The problem is I get OPTIONS request which the application understands and supports, but the server blocks the request which never gets to the application and just displays HTML 405 Error.

Is there some directive to make Nginx serve OPTIONS the same way it serves other methods?

I found many tutorials to enable a response to OPTIONS directly from the Nginx but it doesn't solve my problem as only the application knows which methods are allowed for the URL.

Or am I missing something?

Josef Sábl
  • 111
  • 1
  • 4
  • Does this answer your question? [How to get Nginx to support the HTTP OPTIONS method](https://serverfault.com/questions/242587/how-to-get-nginx-to-support-the-http-options-method) – LTPCGO Jan 07 '20 at 17:56
  • Unfortunately no. It has two contradicting answers. First: Not possible. Second: Yes it does (with no other clues of how). I fear the accepted answer may be correct but I can't believe it. It just doesn't make much sense. And that is the reason I posted this question as I think the case described there is a bit too general (what does "supports" mean?). – Josef Sábl Jan 08 '20 at 08:43

0 Answers0