Created
November 11, 2016 12:56
-
-
Save amgorb/ce0e6c588fcccd176acebce177a255f5 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