-
-
Save cr3a7ure/62900673a60526b86f6bdadd3597d139 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I have Lua script that manipulates cookies and headers based at GET parameters. | |
This script didnt work well at one location, strangely the ngx.var.args was empty with ordinary request. | |
The trick was that in location we have: | |
location /x/ { | |
header_filter_by_lua_file /etc/nginx/lua/referrer_cookie.lua; | |
rewrite ^/x/(.*) /$1 break; | |
try_files $uri /x/index.htm; | |
} | |
in which request went to index.html and all GETs got stripped. Solution was to add $args to the request: | |
location /x/ { | |
header_filter_by_lua_file /etc/nginx/lua/referrer_cookie.lua; | |
rewrite ^/x/(.*) /$1 break; | |
try_files $uri /x/index.htm$is_args$args; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment