Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
133 lines (115 sloc) 2.68 KB
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;
# }
#}