Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to have a MySQL query in my Nginx config?

For example:

server {
        listen       80;
        $domain = [a way to get the current domain];
        $server_info = [a way to do the query (by $domain) and have some info returned];
        server_name $serverinfo;
        [do stuff]
share|improve this question
Have a look at this NginX module (might be a bit outdated btw) – j0k Jun 18 '13 at 8:00
aha thanks, this will do fine :-) – Bob van Luijt Jun 18 '13 at 8:16

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.