用于在jfryman / nginx模块中启用CORS的Puppet配置

时间:2015-12-02 14:13:18

标签: nginx cors puppet

我当前的Nginx清单文件如下:

# Nginx Setup
class nginx_install {
    class { 'nginx': }

    # Setup a development server
    nginx::resource::upstream { 'api_server_dev':
        members => [
            'localhost:3000',
        ],
    }

    # Setup a production server
    nginx::resource::upstream { 'api_server_prod':
        members => [
            'localhost:5000',
        ]
    }

    # Virtual host for production
    nginx::resource::vhost { 'api.elanic.in':
        proxy => 'http://api_server_prod/',
    }

    # Virtual host for development
    nginx::resource::location { '/dev':
        proxy => 'http://api_server_dev/',
        vhost => 'api.elanic.in',
    }
}

我应该如何修改此清单文件,以便在nginx服务器中启用CORS。我知道这可以在link之后完成。但我更希望通过木偶清单文件来完成。

提前致谢

0 个答案:

没有答案