Advertisement
dexterslab

globals/common-locations.conf

Mar 15th, 2013
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.85 KB | None | 0 0
  1. # Set expires for static files
  2. location ~* \.(?:css|js|ico|svg)$ {
  3.     add_header Cache-Control "max-age=2678400, public";
  4. }
  5.  
  6. # Web fonts needs some special care
  7. # Reference: http://jmoiron.net/blog/serving-fonts-aws-cloudfront/
  8. location ~* \.(?:ttf|eot|woff|otf)$ {
  9.     ### Comment the following line, if you do NOT use an external URL to serve webfonts
  10.     add_header Access-Control-Allow-Origin "*";
  11.     add_header Cache-Control "max-age=2678400, public";
  12. }
  13.  
  14. # Referers for images
  15. location ~ \.(?:jpg|jpeg|gif|png)$ {
  16.     ### Please change the domainname before uncommenting the following
  17.     # valid_referers none blocked www.domainname.com domainname.com;
  18.     # if ($invalid_referer) { return 403; }
  19.  
  20.     add_header Cache-Control "max-age=2678400, public";
  21. }
  22.  
  23. # The rewrite magic
  24. location / {
  25.     try_files $uri $uri/ /index.php?$args;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement