Nginx configuration data type

Asked

Viewed 57 times

0

Is there a specific name for the data format used by Nginx? For example:

upstream app1_upstream {
    server app1:80;
}
server {
    listen 80;
    server_name app1.example.com;

    location / {
        proxy_pass http://app1_upstream;
    }
}

This file looks a lot like a guy JSON, most obviously it is not.

  • 1

    In reality this type of configuration file is called vhost and is only a code interpreted by Nginx. The mounting structure of this file belongs only to Nginx is an emulated code inside a native interpreter. I’ve never heard of it having a specific name.

  • I wanted to mount something that creates this type of file to use as a reverse proxy on servers with Docker, and I wanted to avoid having to concatenate millions of string, I imagined that if this type of format was a standard would have something already ready to manipulate it

  • Couldn’t use json? The syntax is really close to a json with regular expression

  • So, I wanted to build the Nginx configuration file using python for example, with information obtained from the Docker sdk, can you tell me if Nginx accepts configuration in json comun?

  • In all the years I’ve been working with servers I’ve never heard of accepting have you looked at the Nginx documentation? Maybe you can assemble an interpreter.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.