nginx.conf 761 B

12345678910111213141516171819202122232425262728293031
  1. # Default server definition
  2. server {
  3. listen 80;
  4. server_name _;
  5. root /var/www/html;
  6. index index.php index.html index.htm;
  7. location / {
  8. try_files $uri $uri/ /index.php?$args;
  9. }
  10. location ~ \.css {
  11. add_header Content-Type text/css;
  12. }
  13. location ~* \.(js|css|png|jpg|jpeg|gif|ico|woff|woff2|ttf|svg|otf|eot)$ {
  14. try_files $uri =404;
  15. expires 30d;
  16. add_header Cache-Control "public, no-transform";
  17. }
  18. location ~ \.php$ {
  19. include fastcgi_params;
  20. fastcgi_pass unix:/var/run/php-fpm.sock;
  21. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  22. fastcgi_param PATH_INFO $fastcgi_script_name;
  23. }
  24. location ~ /\.ht {
  25. deny all;
  26. }
  27. }