summaryrefslogtreecommitdiff
path: root/roles/install_nginx/files/nginx.conf
blob: b37c7b00e69a95eb9c8c7d1033c80d434304cd69 (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
53
54
55
56
57
58
59
worker_processes  1;

events {
    worker_connections  1024;
}


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

    sendfile        on;
    tcp_nopush  on;
    tcp_nodelay on;
    keepalive_timeout  65;

    access_log off;   
    error_log /var/log/nginx/error.log;

    gzip off;

    charset UTF-8;

    server {
            listen       80 default_server;
            listen [::]:80 default_server ipv6only=on;

            index  index.html index.htm;
            root   /srv/http;

            location / {
                    try_files $uri $uri/ =404;
                    autoindex on;
            }

            error_page   500 502 503 504  /50x.html;
            location = /50x.html {
                    root   /usr/share/nginx/html;
            }

            location /nginx_status {
                    stub_status on;
                    access_log   off;
                    allow 127.0.0.1;
                    allow ::1;
                    deny all;
            }

            location ~* \.(?:jpg|jpeg|gif|bmp|ico|png|css|js|swf|svg)$ {
                    expires 30d;
            # Optional: Don't log access to assets
                    access_log off;
            }
    }

    # Virtual Host Config
    include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*;
}