upstream nailgun-application {
    server 127.0.0.1:8001;
}

server {
    listen   8000;

    server_name localhost;

    access_log /var/log/nginx/access_nailgun.log;
    error_log /var/log/nginx/error_nailgun.log debug;

    charset utf-8;
    client_max_body_size 10M;

    location = /favicon.ico {
        log_not_found off;
        access_log off;
    }

    location /static {
        autoindex on;
        alias <%= staticdir %>;
    }

    location /dump {
        alias <%= logdumpdir %>;
    }

    location ~ ^/ostf/(.*) {
        proxy_pass http://127.0.0.1:8777/v1/$1;
        proxy_buffering off;
    }

    location / {
        proxy_pass http://nailgun-application;
        proxy_read_timeout 2m;
        proxy_redirect off;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}

upstream nailgun-application {
    server 127.0.0.1:8001;
}

server {
    listen   8000;

    server_name localhost;

    access_log /var/log/nginx/access_nailgun.log;
    error_log /var/log/nginx/error_nailgun.log debug;

    charset utf-8;
    client_max_body_size 10M;

    location = /favicon.ico {
        log_not_found off;
        access_log off;
    }

    gzip on;
    gzip_min_length 1000;
    gzip_types text/plain application/json;

    location /static {
        autoindex on;
        alias <%= staticdir %>;
    }

    location /dump {
        alias <%= logdumpdir %>;
    }

    location ~ ^/ostf/(.*) {
        proxy_pass http://127.0.0.1:8777/v1/$1;
        proxy_buffering off;
    }

    location / {
        proxy_pass http://nailgun-application;
        proxy_read_timeout 2m;
        proxy_redirect off;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}

Enable gzip in Nginx for Nailgun 'text/plain' and 'application/json' content types
Enable gzip in Nginx for Nailgun 'text/plain' and 'application/json' content types
