NGINX Frontend and Static Server with same SSL - ghomem/legacy_puppet_infrastructure GitHub Wiki

To have both nginx_frontend and nginx_static working with the same SSL certificates, declare the ssl certificate class in the node and set manage_ssl to false in the nginx resources. An example of these resources working together is as follows:

puppet_infrastructure::ssl_nginx_domain { 'example.com':
    sslprefix => 'example.com',
}

puppet_infrastructure::nginx_static_domain { 'example.com':
    domain            => 'files.example.com',
    www_root          => '/var/www/html',
    ssl               => true,
    static_sslprefix  => 'example.com',
    manage_ssl        => false,
}


class {'puppet_infrastructure::nginx_frontend':
    domain                  => 'example.com',
    frontend_sslprefix      => 'example.com',
    backend_hosts_and_ports => ['127.0.0.1:8000', ],
    backend_protocol        => 'http',
    manage_ssl              => false,
}

You can find a complete node declaration example for this use case here: https://bitbucket.org/asolidodev/puppet_infrastructure/src/stable/node-examples/nginx-frontend/nginx-frontend04.pp

⚠️ **GitHub.com Fallback** ⚠️