summaryrefslogtreecommitdiff
path: root/conf/nginx.conf
blob: 47a613e9608d47c0d77bba75aaf3122583ff3b43 (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
60
61
user humpfmprod;
worker_processes  5;
error_log  /var/log/nginx/error.log;
pid        /var/run/nginx.pid;

events {
    worker_connections  1024;
    # multi_accept on;
}

http {
    include         /etc/nginx/mime.types;
    log_format hyphen '$remote_addr | $time_local | '
                        '"$request" | $pipe | $status | $request_time | $bytes_sent | $body_bytes_sent | '
                        '"$http_referer" | "$http_user_agent"';
    access_log      /var/log/nginx/access.log hyphen;
    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;
    tcp_nodelay        on;

    gzip  on;
    gzip_disable "MSIE [1-6]\.(?!.*SV1)";

    include /etc/nginx/conf.d/*.conf;
    
    server {
        listen       80;
	error_page 502 = /static/error/502.html;
        server_name  .hump.fm;
        client_max_body_size 15m;

	location /502test {
		return 502;
	}

        location ~* /(avatars|images)/ {
            if (!-f $request_filename) {
                rewrite ^(.*)$ https://archive.hump.fm$1;
                break;
            }

            root     /home/humpfmprod/prod;
            expires  30d;            
        }

        location ~* /static/ {
            root              /home/humpfmprod/prod;
            expires           5m;
        }

        location / {
            proxy_pass        http://127.0.0.1:8080;
            proxy_redirect    off;
            proxy_set_header  Host $host;
            proxy_set_header  X-Real-IP $remote_addr;
        }
    }
}