Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
# sudo nano /opt/nginx/conf/nginx.conf
worker_processes 2;
worker_rlimit_nofile 100000;
events {
worker_connections 768;
use epoll;
multi_accept on;
http {
passenger_root /home/deploy/.rvm/gems/ruby-2.0.0-p594/gems/passenger-4.0.53;
passenger_ruby /home/deploy/.rvm/gems/ruby-2.0.0-p594/wrappers/ruby;
include mime.types;
default_type application/octet-stream;
keepalive_timeout 30;
tcp_nopush on;
tcp_nodelay on;
open_file_cache max=50000 inactive=20s;
open_file_cache_valid 30s;
open_file_cache_min_uses 2;
open_file_cache_errors on;
reset_timedout_connection on;
client_body_timeout 10;
send_timeout 2;
large_client_header_buffers 4 256k;
limit_conn_zone $binary_remote_addr zone=conn_limit_per_ip:10m;
limit_req_zone $binary_remote_addr zone=req_limit_per_ip:10m rate=30r/s;
limit_conn conn_limit_per_ip 20;
limit_req zone=req_limit_per_ip burst=20;
sendfile on;
server {
listen 80;
root /home/deploy/culture/public;
passenger_enabled on;
limit_conn conn_limit_per_ip 30;
limit_req zone=req_limit_per_ip burst=10 nodelay;
location ~/img {
limit_conn conn_limit_per_ip 999;
limit_req zone=req_limit_per_ip burst=999 nodelay;
client_body_buffer_size 128k;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment