Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question | Possible to have subs_filter match a stored var regex named sub pattern #21

Open
C0nw0nk opened this issue Oct 12, 2016 · 1 comment

Comments

@C0nw0nk
Copy link

C0nw0nk commented Oct 12, 2016

So I am re-writing links like so

set $querystring "?md5=";
subs_filter (.*\.mp4) $1$querystring gir;

Replace link.mp4 file on html output

<video width="320" height="240" controls>
<source src="1.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>

is it possible to take the string that the regex matched in $1 and store it like this. (The code bellow does not work) what is why I am curious if there is any other way even with Nginx Lua ?
set $storedvar $1;

Thanks in advanced fantastic module <3

@C0nw0nk
Copy link
Author

C0nw0nk commented Oct 12, 2016

I just tried the following same empty output and this should work since its a regex named sub pattern

set $querystring "?md5="; #query string on end of url to add
set $insertvar ""; #nginx would say unknown var unless this is here
subs_filter \"(?<insertvar>.*)\.mp4\" \"$insertvar.mp4$querystring\" gir;

@C0nw0nk C0nw0nk changed the title Question | Possible to have subs_filter match $1 stored var Question | Possible to have subs_filter match $1 stored var named sub pattern Oct 12, 2016
@C0nw0nk C0nw0nk changed the title Question | Possible to have subs_filter match $1 stored var named sub pattern Question | Possible to have subs_filter match a stored var regex named sub pattern Oct 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant