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

查看:91
本文介绍了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 %}
}

解决方案

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

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

这篇关于lua - 请问大神,nginx.conf中有两段语法不知道是什么意思的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆