kaltura / nginx-vod-module

NGINX-based MP4 Repackager
GNU Affero General Public License v3.0
1.96k stars 431 forks source link

something in each request with CDN #1509

Open Saeeed-B opened 4 months ago

Saeeed-B commented 4 months ago

Hi, considering that CDN does not send the request to the server, If I want to do something in each request, for example, to save a series of statistics in the database or to check the request header, what should I do?

erankor commented 4 months ago

It depends on what you want to do... e.g. a simple header check can be implemented using the nginx if directive, or nginx auth_request. If you need something more complex, you can use nginx-lua to write custom Lua code in various phases of the request (e.g. access_by_lua_block)

Saeeed-B commented 4 months ago

Well, the point is that cdn does not transfer the request to our vod server in every req . And response himself