Advertisement
Guest User

nginx conf

a guest
Jul 16th, 2018
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.78 KB | None | 0 0
  1. server {
  2. listen *:80;
  3. server_name vds.example.com www.vds.example.com *.gq *.tk;
  4. root /home/user1/web/vds.example.com/public_html;
  5. index index.php index.html index.htm;
  6. access_log /var/log/nginx/domains/vds.example.com.log combined;
  7. access_log /var/log/nginx/domains/vds.example.com.bytes bytes;
  8. error_log /var/log/nginx/domains/vds.example.com.error.log error;
  9.  
  10. rewrite sitemap\.xml$ /sitemap.php break;
  11. rewrite robots\.txt$ /robots.php break;
  12.  
  13. if (!-e $request_filename) {
  14. rewrite ^.*$ /index.php last;
  15. }
  16.  
  17. location / {
  18.  
  19. location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
  20. expires max;
  21. }
  22.  
  23. location ~ \.php$ {
  24. fastcgi_pass unix:/run/php/php7.0-fpm.sock;
  25. fastcgi_index index.php;
  26. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  27. fastcgi_param PHP_VALUE "error_log=/var/log/nginx/pack_errors.log";
  28. fastcgi_buffers 16 16k;
  29. fastcgi_buffer_size 32k;
  30. include fastcgi_params;
  31. }
  32. }
  33.  
  34. error_page 403 /error/404.html;
  35. error_page 404 /error/404.html;
  36. error_page 500 502 503 504 /error/50x.html;
  37.  
  38. location /error/ {
  39. alias /home/user1/web/vds.example.com/document_errors/;
  40. }
  41.  
  42. location ~* "/\.(htaccess|htpasswd)$" {
  43. deny all;
  44. return 404;
  45. }
  46.  
  47. location /vstats/ {
  48. alias /home/user1/web/vds.example.com/stats/;
  49. include /home/user1/conf/web/vds.example.com.auth*;
  50. }
  51.  
  52. include /etc/nginx/conf.d/phpmyadmin.inc*;
  53. include /etc/nginx/conf.d/phppgadmin.inc*;
  54. include /etc/nginx/conf.d/webmail.inc*;
  55.  
  56. include /home/user1/conf/web/nginx.vds.example.com.conf*;
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement