Advertisement
Guest User

Untitled

a guest
Jun 19th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.11 KB | None | 0 0
  1. server {
  2. listen 443 ssl http2;
  3. server_name domain.com www.domain.com;
  4. rewrite ^(.*) http://domain.com$1 permanent;
  5. }
  6. server {
  7. listen 80;
  8. server_name www.domain.com;
  9. rewrite ^(.*) http://domain.com$1 permanent;
  10. }
  11. server {
  12. listen 80;
  13.  
  14. # access_log off;
  15. access_log /home/domain.com/logs/access.log;
  16. # error_log off;
  17. error_log /home/domain.com/logs/error.log;
  18.  
  19. root /home/domain.com/public_html;
  20. index index.php index.html index.htm;
  21. server_name domain.com;
  22.  
  23. error_page 404 /404.html;
  24. location = /404.html {
  25. root /home/domain.com/public_html;
  26. internal;
  27. }
  28. # Custom configuration
  29. include /home/domain.com/public_html/*.conf;
  30.  
  31. location ~ \.php$ {
  32. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  33. include /etc/nginx/fastcgi_params;
  34. fastcgi_pass 127.0.0.1:9000;
  35. fastcgi_index index.php;
  36. fastcgi_connect_timeout 300;
  37. fastcgi_send_timeout 300;
  38. fastcgi_read_timeout 300;
  39. fastcgi_buffer_size 32k;
  40. fastcgi_buffers 8 16k;
  41. fastcgi_busy_buffers_size 32k;
  42. fastcgi_temp_file_write_size 32k;
  43. fastcgi_intercept_errors on;
  44. fastcgi_param SCRIPT_FILENAME /home/domain.com/public_html$fastcgi_script_name;
  45. }
  46. location ~ /\. {
  47. deny all;
  48. }
  49. location = /favicon.ico {
  50. log_not_found off;
  51. access_log off;
  52. }
  53. location = /robots.txt {
  54. allow all;
  55. log_not_found off;
  56. access_log off;
  57. }
  58. location ~* \.(3gp|gif|jpg|jpeg|png|ico|wmv|avi|asf|asx|mpg|mpeg|mp4|pls|mp3|mid|wav|swf|flv|exe|zip|tar|rar|gz|tgz|bz2|uha|7z|doc|docx|xls|xlsx|pdf|iso|eot|svg|ttf|woff)$ {
  59. gzip_static off;
  60. add_header Pragma public;
  61. add_header Cache-Control "public, must-revalidate, proxy-revalidate";
  62. access_log off;
  63. expires 30d;
  64. break;
  65. }
  66.  
  67. location ~* \.(txt|js|css)$ {
  68. add_header Pragma public;
  69. add_header Cache-Control "public, must-revalidate, proxy-revalidate";
  70. access_log off;
  71. expires 30d;
  72. break;
  73. }
  74. location ~ (.*)/$ {
  75. }
  76. location / {
  77. if (!-e $request_filename){
  78. rewrite ^(.*)$ $1/ redirect;
  79. }
  80. }
  81.  
  82. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement