beavyHQ/beavy

View on GitHub
.infrastructure/nginx/nginx.tmpl

Summary

Maintainability
Test Coverage
user  nginx;
daemon off;
worker_processes  4;

error_log  /proc/self/fd/2 warn;
pid        /var/run/nginx.pid;


events {
    worker_connections  1024;
}


http {
    resolver 8.8.8.8;
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    '$status $body_bytes_sent "$http_referer" '
    '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile        on;

    keepalive_timeout  65;

    gzip on;
    gzip_disable "msie6";

    server {
        listen 80;
        access_log /proc/self/fd/1;
        error_log /proc/self/fd/2;
        location /assets {
       root /assets;
           index noindex;
        }
        location / {
            proxy_intercept_errors on;
            proxy_pass http://{{ HAPROXY_PORT_80_TCP_ADDR }}:{{ HAPROXY_PORT_80_TCP_PORT }}$request_uri?;
        proxy_set_header Host $server_name;
        }
    }
}