Advertisement
kreezxil

my vhost for nginx

Jun 1st, 2015
312
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | None | 0 0
  1. server {
  2. listen 80; #IPv4
  3. listen [::]:80; #IPv6
  4.  
  5. # Host that will serve this project.
  6. server_name extreme.serveminecraft.net;
  7.  
  8. # Useful logs for debugging.
  9. access_log /var/log/nginx/TechnicSolder/access.log;
  10. error_log /var/log/nginx/TechnicSolder/error.log;
  11. rewrite_log on;
  12.  
  13. # The location of our projects public directory.
  14. root /usr/share/nginx/html/TechnicSolder/public/;
  15. index index.php index.html index.htm;
  16.  
  17. location / {
  18. # URLs to attempt, including pretty ones.
  19. try_files $uri $uri/ /index.html;
  20. autoindex on;
  21. autoindex_exact_size off;
  22. autoindex_localtime on;
  23. }
  24.  
  25. # PHP FPM configuration.
  26. location ~* \.php$ {
  27. fastcgi_pass unix:/var/run/php5-fpm.sock;
  28. fastcgi_index index.php;
  29. fastcgi_split_path_info ^(.+\.php)(.*)$;
  30. include fastcgi_params;
  31. fastcgi_param PATH_INFO $fastcgi_path_info;
  32. }
  33.  
  34. # We don't need .ht files with nginx.
  35. location ~ /\.ht {
  36. deny all;
  37. }
  38.  
  39. # Hide dot files/folders
  40. location ~ .*/\. {
  41. return 403;
  42. }
  43.  
  44. # Set header expirations on per-project basis
  45. location ~* \.(?:ico|css|js|jpe?g|JPG|png|svg|woff)$ {
  46. expires 365d;
  47.  
  48. }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement