lua - Could you please tell me what the two paragraphs of syntax in nginx.conf mean?
ringa_lee
ringa_lee 2017-05-16 17:11:42
0
2
569

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_lee
ringa_lee

ringa_lee

reply all(2)
为情所困

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.

phpcn_u1582

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template