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