multiple ssl certificates within single server {} block

Tim Düsterhus timwolla at
Tue Nov 5 16:27:47 UTC 2013

On 05.11.2013 14:57, Richard Kearsley wrote:
> this could go on for 100's of domains...

This sounds like you want to use `include`, i use it myself for general
settings, valid for any domain:

    server {
        listen 443 ssl;
        include /etc/nginx/ssl-common.conf;
        ssl_certificate /etc/nginx/ssl/com.example.crt;

        include /etc/nginx/common.conf;

With the contents of /etc/nginx/common.conf being:

    location ~ /.ht {
        return 444;
    add_header X-Frame-Options SAMEORIGIN;


More information about the nginx mailing list