如何从Nginx中的cookie中提取一些值

问题描述:

我是Nginx的新手,希望获得一些帮助.

I am new to Nginx and hope to get some help.

我想从nginx的浏览器cookie中提取某些数据(某些PHP脚本设置的字段),以便进行记录.如果可能的话,我只想通过修改nginx配置来做到这一点.

I want to extract certain data (certain fields set by my PHP scripts) from browser cookie in nginx so that I can log it. If possible, I want to do this just by modifying nginx configuration.

任何指针/帮助将不胜感激.

Any pointer/help would be greatly appreciated.

您可以使用$cookie_COOKIE_NAME_GOES_HERE变量来访问cookie值.

You can access cookie values by using the $cookie_COOKIE_NAME_GOES_HERE variable.

请参见 Nginx文档