Skip to content

Instantly share code, notes, and snippets.

@guipmourao
Last active August 29, 2015 14:17
Show Gist options
  • Save guipmourao/4e4b2101b174a0473ffd to your computer and use it in GitHub Desktop.
Save guipmourao/4e4b2101b174a0473ffd to your computer and use it in GitHub Desktop.
user nginx;
worker_processes 1;
pid /var/run/nginx.pid;
events {
worker_connections 768;
multi_accept on;
use epoll;
}
http {
# Let NGINX get the real client IP for its access logs
set_real_ip_from 127.0.0.1;
real_ip_header X-Forwarded-For;
# Basic Settings
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 20;
client_max_body_size 15m;
client_body_timeout 60;
client_header_timeout 60;
client_body_buffer_size 1K;
client_header_buffer_size 1k;
large_client_header_buffers 4 8k;
send_timeout 60;
reset_timedout_connection on;
types_hash_max_size 2048;
server_tokens off;
# server_names_hash_bucket_size 64;
# server_name_in_redirect off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
##
# Logging Settings
##
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
log_format uagents '$http_user_agent';
log_format apachestandard '$remote_addr $http_inventory_hostname $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent"';
log_format wpengine '$time_local|v1|$remote_addr|$http_inventory_hostname|$status|$body_bytes_sent|$upstream_addr|$upstream_response_time|$request_time|$request';
log_format wpengine2 '$time_local|vx|$remote_addr|$http_inventory_hostname|$status|$body_bytes_sent|$upstream_addr|$upstream_response_time|$request_time|$request|$args|$http_user_agent|$http_referer|$http_cache_control';
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
##
# Gzip Settings
##
gzip on;
gzip_static on;
gzip_disable "msie6";
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_min_length 512;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/css text/javascript text/xml text/plain text/x-component
application/javascript application/x-javascript application/json
application/xml application/rss+xml font/truetype application/x-font-ttf
font/opentype application/vnd.ms-fontobject image/svg+xml;
##
# nginx-naxsi config
##
# Uncomment it if you installed nginx-naxsi
##
#include /etc/nginx/naxsi_core.rules;
##
# nginx-passenger config
##
# Uncomment it if you installed nginx-passenger
##
#passenger_root /usr;
#passenger_ruby /usr/bin/ruby;
##
# Virtual inventory_hostname Configs
##
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment