Capture lines based on keywords

Hello everyone,
I am trying to write a script that will capture few lines from a text file based on 2 keywords in the first line and 1 keyword in the last one. It could also be based on the first line only + the folllowing 3 lines.
Could some one help or give directions. Thanks.

awk '/keyword1.*keyword2/, /keyword3/' infile

This is great... thanks.
However, I am not able to use one of the keywords as a variable ($keyword2)?! Any idea?

awk '/keyword1.*$keyword2/, /keyword3/' infile

awk '$0 ~ "key1.*" var, /key2/' var="foo" infile

Thank you for your help.