1. server {
  2. listen 80;
  3. server_name mail.intietkiem.com;
  4. #sendy
  5. location ~ /(l|t|w|(un)?subscribe)/ {
  6. rewrite ^/([^/]+)/([a-zA-Z0-9/]+)$ /$1.php?i=$2 last;
  7. }
  8. location / {
  9. rewrite ^/([a-zA-Z0-9\-]+) /$1.php?$args last;
  10. }
  11. #het sendy
  12. rewrite ^(.*) http://mail.intietkiem.com$1 permanent;
  13. }
  14. server {
  15. listen 80;
  16. # access_log off;
  17. access_log /home/mail.intietkiem.com/logs/access.log;
  18. # error_log off;
  19. error_log /home/mail.intietkiem.com/logs/error.log;
  20. root /home/mail.intietkiem.com/public_html;
  21. index index.php index.html index.htm;
  22. server_name mail.intietkiem.com;
  23. location / {
  24. try_files $uri $uri/ /index.php?$args;
  25. }
  26. # Custom configuration
  27. include /home/mail.intietkiem.com/public_html/*.conf;
  28. location ~ \.php$ {
  29. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  30. include /etc/nginx/fastcgi_params;
  31. fastcgi_pass 127.0.0.1:9000;
  32. fastcgi_index index.php;
  33. fastcgi_connect_timeout 300;
  34. fastcgi_send_timeout 300;
  35. fastcgi_read_timeout 300;
  36. fastcgi_buffer_size 32k;
  37. fastcgi_buffers 8 16k;
  38. fastcgi_busy_buffers_size 32k;
  39. fastcgi_temp_file_write_size 32k;
  40. fastcgi_intercept_errors on;
  41. fastcgi_param SCRIPT_FILENAME /home/mail.intietkiem.com/public_html$fastcgi_script_name;
  42. }
  43. # Disable .htaccess and other hidden files
  44. location ~ /\.(?!well-known).* {
  45. deny all;
  46. access_log off;
  47. log_not_found off;
  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. location ~* \.(txt|js|css)$ {
  67. add_header Pragma public;
  68. add_header Cache-Control "public, must-revalidate, proxy-revalidate";
  69. access_log off;
  70. expires 30d;
  71. break;
  72. }
  73. }