Hello!
On Mon, Jan 27, 2014 at 6:27 PM, Mark Constable wrote:
>
> Right, I am still surprised ngx.var.server_name does not hold the
> interpolated
> value of server_name but I guess it's for performance reasons.
IMHO, it is the right way to uniquely and precisely identify the
current virtual server. This is what the $server_name variable is
designed for, to distinguish various virtual servers (or server {}
blocks) defined in nginx.conf.
The user always has the option to obtain the actual captured value by
the regex anyway (as demonstrated by the $domain variable).
> Thank you for
> the excellent example, appreciated.
>
You're welcome :)
> If anyone happens to know of any really simple examples I'd appreciate any
> links.
> I know there are some introductory examples around
Maybe you have already read the stuffs on openresty.org? Especially
the tutorials below?
http://openresty.org/#eBooks
> but once past those it's
> hard
> to find various other examples about different aspects of openresty that do
> not
> descend into a level of complexity that I can no longer easily understand.
Yeah, I understand the barrier. And I'm going to write more articles
on more advanced topics in a (hopefully) very friendly manner.
> Trying
> to understand how a new language works, and also how it interacts inside
> nginx,
> deserves a good book.
>
Agreed. But writing a book is a big project for its own right. And we
can start by writing more articles and tutorials. And at some point,
it should be relatively easy to re-organize all these into a real book
:)
Thanks for the suggestion!
Best regards,
-agentzh