首頁  >  問答  >  主體

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

第二段如下:
如下這段upstream中的程式碼是什麼意思?是哪個第三方模組提供的?求教

upstream gateway-service {
   {% for host in groups['platform_gateway'] %}server {{host}}:8011;
{% endfor %}
}
ringa_leeringa_lee2713 天前536

全部回覆(2)我來回復

  • 为情所困

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

    這個應該是你用的雲端平台提供的,而這兩段nginx配置應該是個配置模板,你修改之後,平台那邊會將其作為模板解析生成真實的nginx配置文件。

    不清楚你這個配置是從哪裡來的,所以以上是我的猜測。

    回覆
    0
  • phpcn_u1582

    phpcn_u15822017-05-16 17:13:42

    看起來是salt推送設定的sls檔。不能拿來直接使用。

    回覆
    0
  • 取消回覆