nginx proxy_pass based on whether request method is POST, PUT or DELETE

后端 未结 4 834
春和景丽
春和景丽 2020-12-23 10:36

I have two iKaaro instances running on port 8080 and 9080, where the 9080 instance is Read only.

I am unsure how to use nginx for example if the request method is PO

4条回答
  •  暖寄归人
    2020-12-23 11:22

    In case someone looking for a way to simply make conditions by request method, the syntax is:

    if ($request_method = DELETE ) {
       . . . 
    }
    

提交回复
热议问题