Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
97 lines (85 sloc) 1.96 KB
user www-data;
worker_processes auto;
pid /run/nginx.pid;
events {
worker_connections 8192;
# multi_accept on;
}
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;
upstream backend {
server app0891:5000;
server app0891:5000;
}
server {
listen 80;
#root /home/isucon/icons;
root /home/isucon/isubata/webapp/public;
client_body_temp_path /dev/shm/client_temp;
dav_methods PUT DELETE MKCOL COPY MOVE;
create_full_put_path on;
dav_access group:rw all:r;
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 / {
gzip on;
gzip_types *;
proxy_set_header Host $http_host;
proxy_pass http://backend;
}
# アップロードサイズの上限
client_max_body_size 100m;
location /icons {
root /home/isucon/icons;
add_header Cache-Control "public, max-age=31536000, immutable";
etag off;
# IPを制限する場合
limit_except GET HEAD {
allow 192.168.101.1;
allow 192.168.101.2;
allow 192.168.101.3;
allow 127.0.0.1;
deny all;
}
}
}
}