[IMP] runbot: make nginx server_name more specific

Avoids overly generic vhost declaration, and makes config easier to
understand.

We only want to allow such hosts:
    <build_dest>.runbotX.odoo.com
    <build_dest>-<db_name_extension>.runbotX.odoo.com

Where <db_name_extension> is usually "all" or "base".
This commit is contained in:
Olivier Dony 2018-07-30 12:11:27 +02:00
parent e815571d14
commit b98b8dedd9

View File

@ -47,7 +47,7 @@ server {
<t t-foreach="builds" t-as="build">
server {
listen 8080;
server_name ~^<t t-raw="re_escape(build.dest)"/>[-.].*$;
server_name ~^<t t-raw="re_escape(build.dest)"/>(-[a-z0-9]+)?\.<t t-raw="re_escape(fqdn)"/>$;
location / { proxy_pass http://127.0.0.1:<t t-esc="build.port"/>; }
location /longpolling { proxy_pass http://127.0.0.1:<t t-esc="build.port + 1"/>; }
}