arut / nginx-python-module

Nginx Python Module
BSD 2-Clause "Simplified" License
137 stars 36 forks source link

python_access inside if block #6

Open coleplx opened 4 years ago

coleplx commented 4 years ago

Hi :)

Why aren't we able to invoke python_access and python_include inside "if" blocks? It works inside a location block, but not on "if".

I ask this because I wrote a simple python script to PURGE slice caches from nginx cache dir, and I'd like to invoke it when the request_method = PURGE. At the moment, this is not possible, so I had to adapt my script do expect requests coming from "$host / purge / $request" instead of PURGE $host / $request only

PS: Thanks for the module. :)