At work, we have Nginx sitting in front of Apache, to take some of the load off. We’ve also decided that we should use our bandwidth sparingly, and compress/minify Javascript/CSS. To do that, we’re using the built in Embedded Perl Module functionality inherent within Nginx. But because we have several different sites running on a single Nginx server, we need to make sure that we store the .js/.css files in the correct location, or run the risk of overwriting the wrong files or even serving incorrect data.
The documentation suggests that any request header can be pulled via $r->header_in(). However, it doesn’t give you a list of header conversions. Normally, you’d use SERVER_NAME, or the like. But in Nginx, it’s called host. Unfortunately, that information doesn’t seem to be disseminated very widely, so I’m posting it here, in the hopes that it will help some other lost traveler later.
