Advertisement
Guest User

nginx

a guest
Aug 11th, 2011
852
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.05 KB | None | 0 0
  1.         server {
  2.             listen ip:80;
  3.             server_name     yourserver.com cdn1.yourserver.com;
  4.             root /srv/http/nginx/yourserver.com;
  5.             access_log      logs/yourserver.com.access.log;
  6.            
  7.             ## Static files are served directly
  8.             location ~* \.(?:js|css|png|jpg|jpeg|gif|ico)$ {
  9.                 expires max;
  10.                 add_header Pragma public;
  11.                 add_header Cache-Control "public, must-revalidate, proxy-revalidate";
  12.                 access_log off;
  13.                 log_not_found off;
  14.                 ## No need to bleed constant updates. Send the all shebang in one
  15.                 ## fell swoop.
  16.                 tcp_nodelay off;
  17.                 break;
  18.             }
  19.  
  20.             ## Keep a tab on the 'big' static files
  21.             location ~* ^.+\.(?:m4a|mp[34]|mov|ogg|flv|pdf|ppt[x]*)$ {
  22.                 expires 30d;
  23.                 ## No need to bleed constant updates. Send the all shebang in one
  24.                 ## fell swoop.
  25.                 tcp_nodelay off;
  26.             }
  27.  
  28.             location / {
  29.                 index index.html;
  30.                 charset   utf-8;
  31.             }
  32.      
  33.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement