Created
August 31, 2016 08:14
-
-
Save yassun/787d500f8dfe00623a26c9f0008eea8c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user nginx; | |
worker_processes 4; | |
worker_rlimit_nofile 8192; | |
#error_log /var/log/nginx/error.log; | |
#error_log /var/log/nginx/error.log notice; | |
#error_log /var/log/nginx/error.log info; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 10240; | |
use epoll; | |
} | |
http { | |
include /etc/nginx/mime.types; | |
default_type application/octet-stream; | |
log_format with_time '$remote_addr - $remote_user [$time_local] ' | |
'"$request" $status $body_bytes_sent ' | |
'"$http_referer" "$http_user_agent" $request_time'; | |
#access_log /tmp/access.log with_time; | |
sendfile on; | |
keepalive_timeout 120s; | |
tcp_nopush on; | |
tcp_nodelay on; | |
etag off; | |
upstream app { | |
server unix:/tmp/unicorn.sock; | |
} | |
server { | |
root /home/ishocon/webapp/ruby/public; | |
try_files $uri @app; | |
etag off; | |
server_tokens off; | |
location /images { | |
open_file_cache max=200; | |
} | |
location /css { | |
open_file_cache max=200; | |
} | |
location @app { | |
proxy_set_header Host $host; | |
proxy_set_header X-Forwarded-Host $host; | |
proxy_set_header X-Forwarded-For $http_x_forwarded_for; | |
proxy_pass http://app; | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment