1. server {
  2. listen 80;
  3. server_name www.upperemail.com;
  4. rewrite ^(.*) http://upperemail.com$1 permanent;
  5. }
  6. server {
  7. listen 80 default_server;
  8. # access_log off;
  9. access_log /home/upperemail.com/logs/access.log;
  10. # error_log off;
  11. error_log /home/upperemail.com/logs/error.log;
  12. root /home/upperemail.com/public_html;
  13. index index.php index.html index.htm;
  14. server_name upperemail.com;
  15. location / {
  16. try_files $uri $uri/ /index.php?$args;
  17. }
  18. # Custom configuration
  19. include /home/upperemail.com/public_html/*.conf;
  20. location ~ \.php$ {
  21. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  22. include /etc/nginx/fastcgi_params;
  23. fastcgi_pass 127.0.0.1:9000;
  24. fastcgi_index index.php;
  25. fastcgi_connect_timeout 1000;
  26. fastcgi_send_timeout 1000;
  27. fastcgi_read_timeout 1000;
  28. fastcgi_buffer_size 256k;
  29. fastcgi_buffers 4 256k;
  30. fastcgi_busy_buffers_size 256k;
  31. fastcgi_temp_file_write_size 256k;
  32. fastcgi_intercept_errors on;
  33. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  34. }
  35. location /nginx_status {
  36. stub_status on;
  37. access_log off;
  38. allow 127.0.0.1;
  39. allow 168.235.107.39;
  40. deny all;
  41. }
  42. location /php_status {
  43. fastcgi_pass 127.0.0.1:9000;
  44. fastcgi_index index.php;
  45. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  46. include /etc/nginx/fastcgi_params;
  47. allow 127.0.0.1;
  48. allow 168.235.107.39;
  49. deny all;
  50. }
  51. # Disable .htaccess and other hidden files
  52. location ~ /\.(?!well-known).* {
  53. deny all;
  54. access_log off;
  55. log_not_found off;
  56. }
  57. location = /favicon.ico {
  58. log_not_found off;
  59. access_log off;
  60. }
  61. location = /robots.txt {
  62. allow all;
  63. log_not_found off;
  64. access_log off;
  65. }
  66. 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)$ {
  67. gzip_static off;
  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 ~* \.(txt|js|css)$ {
  75. add_header Pragma public;
  76. add_header Cache-Control "public, must-revalidate, proxy-revalidate";
  77. access_log off;
  78. expires 30d;
  79. break;
  80. }
  81. }
  82. server {
  83. listen 7568;
  84. access_log off;
  85. log_not_found off;
  86. error_log /home/upperemail.com/logs/nginx_error.log;
  87. root /home/upperemail.com/private_html;
  88. index index.php index.html index.htm;
  89. server_name upperemail.com;
  90. auth_basic "Restricted";
  91. auth_basic_user_file /home/upperemail.com/private_html/hocvps/.htpasswd;
  92. location / {
  93. autoindex on;
  94. try_files $uri $uri/ /index.php;
  95. }
  96. location ~ \.php$ {
  97. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  98. include /etc/nginx/fastcgi_params;
  99. fastcgi_pass 127.0.0.1:9000;
  100. fastcgi_index index.php;
  101. fastcgi_connect_timeout 1000;
  102. fastcgi_send_timeout 1000;
  103. fastcgi_read_timeout 1000;
  104. fastcgi_buffer_size 256k;
  105. fastcgi_buffers 4 256k;
  106. fastcgi_busy_buffers_size 256k;
  107. fastcgi_temp_file_write_size 256k;
  108. fastcgi_intercept_errors on;
  109. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  110. }
  111. location ~ /\. {
  112. deny all;
  113. }
  114. }
Comments powered by Disqus