Skip to content

Instantly share code, notes, and snippets.

@pacojp
Created June 8, 2013 15:45
Show Gist options
  • Save pacojp/5735560 to your computer and use it in GitHub Desktop.
Save pacojp/5735560 to your computer and use it in GitHub Desktop.
user nginx;
worker_processes 3;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
multi_accept on;
use epoll;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
log_format backend '$http_x_forwarded_for - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent"';
access_log /var/log/nginx/access.log main;
server_tokens off;
port_in_redirect off;
server_name_in_redirect off;
sendfile on;
#tcp_nopush on;
keepalive_timeout 15;
gzip on;
gzip_http_version 1.0;
gzip_vary on;
gzip_comp_level 6;
gzip_types text/plain text/xml text/css text/javascript
application/xhtml+xml application/xml
application/rss+xml application/atom_xml
application/javascript application/x-javascript
application/x-httpd-php;
gzip_disable "MSIE [1-6]\.";
#
# does not cache with this proxy
#
#proxy_cache_path /var/cache/nginx levels=1:2
# keys_zone=one:4m max_size=50m inactive=120m;
#proxy_temp_path /var/tmp/nginx;
#proxy_cache_key "$scheme://$host$request_uri";
#proxy_cache_use_stale timeout invalid_header http_500 http_502 http_503 http_504;
#proxy_cache_lock on;
#proxy_cache_lock_timeout 5s;
proxy_connect_timeout 5;
proxy_send_timeout 10;
proxy_read_timeout 120;
proxy_set_header Host $http_host;
proxy_set_header Accept-Encoding "";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_hide_header X-Pingback;
proxy_hide_header X-Powered-By;
proxy_hide_header Etag;
proxy_hide_header Vary;
include /etc/nginx/conf.d/*.conf;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment