Skip to content

Instantly share code, notes, and snippets.

@unders
Created October 14, 2012 07:19
Show Gist options
  • Save unders/3887701 to your computer and use it in GitHub Desktop.
Save unders/3887701 to your computer and use it in GitHub Desktop.
Nginx config parameters
ngx_http_upstream_module
upstream http_backend {
    server 127.0.0.1:8080;

    keepalive 16;
}

server {
    ...

    location /http/ {
        proxy_pass http://http_backend;
        proxy_http_version 1.1; # <= Set it to 1.1 so that keepalive works.
        proxy_set_header Connection ""; # <= This header must be cleared.
        ...
    }
}

Serve compressed content directly from disk

location ~ ^/assets/ {
  expires 1y;
  add_header Cache-Control public;
 
  add_header ETag "";
  break;
}

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment