Mobile app version of vmapp.org
Login or Join
Angela700

: How to query MySQL to build Nginx configuration file? Is it possible to have a MySQL query in my Nginx config? For example: server { listen 80; $domain

@Angela700

Posted in: #Mysql #Nginx

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]
}

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Angela700

1 Comments

Sorted by latest first Latest Oldest Best

 

@Jessie594

(Answer by @jOk )
You can use the NginX moudule located at github.com/arut/nginx-mysql-module which allows you to do exactly what you are asking to do.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme