Skip to content

Instantly share code, notes, and snippets.

@najeira
Created July 18, 2012 09:13
Show Gist options
  • Save najeira/3135184 to your computer and use it in GitHub Desktop.
Save najeira/3135184 to your computer and use it in GitHub Desktop.
nginx.conf example
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" "$request_time"';
sendfile on;
keepalive_timeout 65;
client_header_buffer_size 4k;
client_max_body_size 8m;
server {
listen 80;
server_name example.jp;
access_log off;
error_log /var/log/nginx/error.log;
gzip on;
gzip_types text/css application/x-javascript text/javascript text/html;
location ~* ^/static/(css|js|img|emoji|html)/ {
root /home/example/static;
}
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:8080;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment