-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathnginx.conf
132 lines (115 loc) · 2.68 KB
/
nginx.conf
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
user www-data;
worker_processes 2;
pid /run/nginx.pid;
events {
worker_connections 2048;
}
http {
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
server_tokens off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
error_log /var/log/nginx/error.log;
gzip on;
gzip_disable "msie6";
# gzip_vary on;
# gzip_proxied any;
# gzip_comp_level 6;
# gzip_buffers 16 8k;
# gzip_http_version 1.1;
# gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
log_format ltsv "time:$time_local"
"\thost:$remote_addr"
"\tforwardedfor:$http_x_forwarded_for"
"\treq:$request"
"\tmethod:$request_method"
"\turi:$request_uri"
"\tstatus:$status"
"\tsize:$body_bytes_sent"
"\treferer:$http_referer"
"\tua:$http_user_agent"
"\treqtime:$request_time"
"\truntime:$upstream_http_x_runtime"
"\tapptime:$upstream_response_time"
"\tcache:$upstream_http_x_cache"
"\tvhost:$host";
upstream backend {
server 127.0.0.1:5000;
}
upstream backend_db {
server db:80;
}
server {
listen 80 default_server;
listen [::]:80 default_server;
client_max_body_size 20M;
root /home/isucon/isubata/webapp/public;
#access_log /tmp/access_log ltsv;
access_log off;
location /favicon.ico {
add_header Cache-Control "public, max-age=31536000, immutable";
access_log off;
etag off;
}
location /fonts/ {
add_header Cache-Control "public, max-age=31536000, immutable";
access_log off;
gzip on;
gzip_static on;
gzip_vary on;
gzip_types *;
etag off;
}
location /js/ {
add_header Cache-Control "public, max-age=31536000, immutable";
access_log off;
gzip on;
gzip_static on;
gzip_vary on;
gzip_types *;
etag off;
}
location /css/ {
add_header Cache-Control "public, max-age=31536000, immutable";
access_log off;
gzip on;
gzip_static on;
gzip_vary on;
gzip_types *;
etag off;
}
location /icons {
proxy_pass http://backend_db;
}
location / {
gzip on;
gzip_types *;
proxy_set_header Host $http_host;
proxy_pass http://backend;
}
}
}
#mail {
# # See sample authentication script at:
# # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
#
# # auth_http localhost/auth.php;
# # pop3_capabilities "TOP" "USER";
# # imap_capabilities "IMAP4rev1" "UIDPLUS";
#
# server {
# listen localhost:110;
# protocol pop3;
# proxy on;
# }
#
# server {
# listen localhost:143;
# protocol imap;
# proxy on;
# }
#}