aboutsummaryrefslogtreecommitdiffstats
path: root/example/nginx.conf
blob: 95251864b7bb7f0803fc24583aa62c7ba09a261c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
worker_processes 4;
error_log logs/error.log;

events {
    worker_connections 1024;
}

http {
    include mime.types;
    default_type application/octet-stream;

    log_format ltsv "time:$time_local"
                    "\thost:$remote_addr"
                    "\tforwardedfor:$http_x_forwarded_for"
                    "\treq:$request"
                    "\tstatus:$status"
                    "\tsize:$body_bytes_sent"
                    "\treferer:$http_referer"
                    "\tua:$http_user_agent"
                    "\treqtime:$request_time"
                    "\tcache:$upstream_http_x_cache"
                    "\truntime:$upstream_http_x_runtime"
                    "\tvhost:$host";
    access_log logs/access.log ltsv;

    upstream rack {
        server unix:/var/webapps/aclog/tmp/sockets/web.sock;
    }

    server {
        listen 80;
        server_name aclog;

        location / {
            root /var/webapps/aclog/frontend/dest;
            try_files $uri /index.html;
        }

        # for developing, pass to webpack-dev-server
        # location / {
        #     proxy_pass http://localhost:3001;
        # }

        location ~ ^/(i/)?api/ {
            proxy_pass http://rack;
        }

        location ~ \.atom$ {
            proxy_pass http://rack;
        }
    }
}