nginx.conf 758 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #全局块
  2. #user nobody;
  3. worker_processes 1;
  4. #event块
  5. events {
  6. worker_connections 1024;
  7. }
  8. #http块
  9. http {
  10. #http全局块
  11. sendfile on;
  12. tcp_nopush on;
  13. types_hash_max_size 2048;
  14. # server_tokens off;
  15. # server_names_hash_bucket_size 64;
  16. # server_name_in_redirect off;
  17. include /etc/nginx/mime.types;
  18. default_type application/octet-stream;
  19. #server块
  20. server {
  21. listen 8080;
  22. server_name 0.0.0.0;
  23. location / {
  24. root /usr/share/nginx/html;
  25. try_files $uri $uri/ /index.html;
  26. }
  27. #Static File Caching. All static files with the following extension will be cached for 1 day
  28. location ~* .(jpg|jpeg|png|gif|ico|css|js)$ {
  29. expires 1d;
  30. }
  31. }
  32. }