Guest User

Untitled

a guest
Jun 22nd, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. server {
  2. listen 80 default_server;
  3. server_name localhost;
  4.  
  5. root /usr/share/nginx/html;
  6. index index.html index.htm;
  7.  
  8. location ~* \.(?:manifest|appcache|html?|xml|json)$ {
  9. expires -1;
  10. # access_log logs/static.log; # I don't usually include a static log
  11. }
  12.  
  13. location ~* \.(?:css|js)$ {
  14. try_files $uri =404;
  15. expires 1y;
  16. access_log off;
  17. add_header Cache-Control "public";
  18. }
  19.  
  20. # Any route containing a file extension (e.g. /devicesfile.js)
  21. location ~ ^.+\..+$ {
  22. try_files $uri =404;
  23. }
  24.  
  25. # Any route that doesn't have a file extension (e.g. /devices)
  26. location / {
  27. try_files $uri $uri/ /index.html;
  28. }
  29. }
Add Comment
Please, Sign In to add comment