server {
    server_name  llvm.validation.linaro.org;

    root   /linaro-scripts-monitor/html;
    index  index.html index.htm;

    # redirect server error pages to the static page /50x.html
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }

    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/toolchain.linaro.org/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/toolchain.linaro.org/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}

server {
    server_name  llvm.validation.linaro.org;

    root   /public_html;
    index  index.html index.htm;

    # redirect server error pages to the static page /50x.html
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }

    listen       8080;
}

server {
    server_name  toolchain.linaro.org;

    location / {
        root   /public_html_root;
        index  index.html index.htm;
    }

    location /ci/gnu {
        alias   /public_html;
        index  index.html index.htm;
    }

    location /ci/llvm {
        alias   /linaro-scripts-monitor/html;
        index  index.html index.htm;
    }

    # redirect server error pages to the static page /50x.html
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }

    listen 443 ssl default_server; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/toolchain.linaro.org/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/toolchain.linaro.org/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}

server {
    server_name  toolchain.linaro.org;

    location / {
        # LNT instance with all projects.
        proxy_pass http://toolchain.linaro.org:8081/;
    }

    # redirect server error pages to the static page /50x.html
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }

    listen 9091 ssl;
    ssl_certificate /etc/letsencrypt/live/toolchain.linaro.org/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/toolchain.linaro.org/privkey.pem;
    include /etc/letsencrypt/options-ssl-nginx.conf;
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
}

server {
    server_name  toolchain.linaro.org;

    location / {
        # LNT instance with stable projects.
        proxy_pass http://toolchain.linaro.org:8082/;
    }

    # redirect server error pages to the static page /50x.html
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }

    listen 9092 ssl;
    ssl_certificate /etc/letsencrypt/live/toolchain.linaro.org/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/toolchain.linaro.org/privkey.pem;
    include /etc/letsencrypt/options-ssl-nginx.conf;
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
}

server {
    server_name  toolchain.linaro.org;

    location / {
        # LNT instance with experimental results.
        proxy_pass http://toolchain.linaro.org:8083/;
    }

    # redirect server error pages to the static page /50x.html
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }

    listen 9093 ssl;
    ssl_certificate /etc/letsencrypt/live/toolchain.linaro.org/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/toolchain.linaro.org/privkey.pem;
    include /etc/letsencrypt/options-ssl-nginx.conf;
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
}

server {
    if ($host = toolchain.linaro.org) {
        return 301 https://$host$request_uri;
    } # managed by Certbot

    listen       80 default_server;
    server_name  toolchain.linaro.org;
    return 404; # managed by Certbot
}

server {
    if ($host = llvm.validation.linaro.org) {
        return 301 https://$host$request_uri;
    } # managed by Certbot

    listen       80;
    server_name  llvm.validation.linaro.org;
    return 404; # managed by Certbot
}
