登录

lua - 请问大神,nginx.conf中有两段语法不知道是什么意思

第一段如下所示,这个{{platform_port}}这个变量是从哪里得到的?是在哪里定义的?

#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 $1-app;
            proxy_pass http://$vhost;
        }
    }
}

第二段如下所示:
如下这段upstream中的代码是什么意思?是哪个第三方模块提供的?求教

upstream gateway-service {
   {% for host in groups['platform_gateway'] %}server {{host}}:8011;
{% endfor %}
}
# Linux
ringa_lee ringa_lee 2528 天前 442 次浏览

全部回复(2) 我要回复

  • 为情所困

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

    这个应该是你用的云平台提供的,而这两段nginx配置应该是个配置模板,你修改之后,平台那边会将其作为模板解析生成真实的nginx配置文件。

    不清楚你这个配置是从哪里来的,所以以上是我的猜测。

    回复
    0
  • phpcn_u1582

    phpcn_u15822017-05-16 17:13:42

    看样子是salt推送配置的sls文件。不能拿来直接使用。

    回复
    0
  • 取消 回复 发送