search

Home  >  Q&A  >  body text

lua - Could you please tell me what the two paragraphs of syntax in nginx.conf mean?

The first paragraph is as follows, where does the {{platform_port}} variable come from? Where is it defined?

#paas app 
server {
    listen   {{platform_port}};
    server_name *.{{platform_domain}};     #Wildcard app domain

    error_log  /data/infra/nginx/log/app.error.log warn;
    access_log  /data/infra/nginx/log/app.access.log  main;
    
    include conf.d/include/proxy.conf;
    include conf.d/include/error_page.conf;

    location / {
        if ($host ~* ([^\.]+)\.(.*)) {
            set $vhost -app;
            proxy_pass http://$vhost;
        }
    }
}

The second paragraph is as follows:
What does the following code in upstream mean? Which third-party module is provided? Ask for advice

upstream gateway-service {
   {% for host in groups['platform_gateway'] %}server {{host}}:8011;
{% endfor %}
}
ringa_leeringa_lee2754 days ago561

reply all(2)I'll reply

  • 为情所困

    为情所困2017-05-16 17:13:42

    This should be provided by the cloud platform you are using, and these two pieces of nginx configuration should be a configuration template. After you modify it, the platform will parse it as a template to generate a real nginx configuration file.

    I don’t know where your configuration came from, so the above is my guess.

    reply
    0
  • phpcn_u1582

    phpcn_u15822017-05-16 17:13:42

    It looks like the sls file of salt push configuration. It cannot be used directly.

    reply
    0
  • Cancelreply