<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Jun 20, 2013 at 2:00 AM, Maxim Dounin <span dir="ltr"><<a href="mailto:mdounin@mdounin.ru" target="_blank">mdounin@mdounin.ru</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello!<br>
<div><div class="h5"><br>
On Wed, Jun 19, 2013 at 11:06:19AM -0700, Mark Moseley wrote:<br>
<br>
> TL;DR:<br>
> Any nginx setting to say 'if a vhost's ssl settings are broken, skip it and<br>
> don't fail to start' ?<br>
><br>
> I've certainly RTFM'd this and peered at the source, but I figured I might<br>
> as well throw it out there, in case there's some hidden setting I've missed.<br>
><br>
> I'm building a reverse proxy config for thousands of SSL virtual hosts, to<br>
> replace an apache solution.<br>
><br>
> It very often happens that someone in support will make a mistake with<br>
> regards to certs/keys. E.g. updating someone's SSL cert but actually<br>
> putting the CSR there instead.<br>
><br>
> In apache, since the config is being generated out of mod_perl, I can get<br>
> around this situation by having mod_perl do a modulus check on the cert and<br>
> key and skip the vhost if they don't match. In my case, I'd far prefer to<br>
> have a missing vhost and have the other 1000 sites working, than all down.<br>
><br>
> And, yes, I realize in default apache, it'd just fail to load. And also,<br>
> yes, I realize asking something to ignore broken configs is a bit<br>
> non-standard :)<br>
><br>
> Since I don't have mod_perl at my fingertips in nginx to perform a similar<br>
> trick, the startup will just fail.<br>
><br>
> So I was curious if there's some obscure setting to tell nginx "if a vhost<br>
> fails to loads its cert properly (or potentially any other vhost setting),<br>
> skip it and continue loading the rest"?<br>
><br>
> If such a thing did exist, I imagine that the configtest would have to turn<br>
> errors for that vhost into warnings as well.<br>
><br>
> My guess is obviously 'no', but I figured asking woud only cost me the time<br>
> it takes to compose an email.<br>
<br>
</div></div>In nginx, there are two mechanism to deal with configuration<br>
errors:<br>
<br>
1) On configuration reload nginx refuses to load a new<br>
configuration if there are errors (and continues to work with<br>
previously loaded correct configuration).<br>
<br>
2) There is "nginx -t" to test configs.<br>
<br>
By using the two you are safe from a situation when a typo<br>
in configuration takes a service down (well, mostly: one always<br>
can take it down with a valid config). There is no kludge to<br>
magically apply only parts of a configuration though.<br>
<span class="HOEnZb"></span><br></blockquote><div><br></div><div>Yup, that's what I figured. Thanks for confirming. <br></div></div><br></div></div>