Advertisement
Guest User

Untitled

a guest
Sep 7th, 2017
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.07 KB | None | 0 0
  1. server {
  2. listen 80;
  3.  
  4. server_name www.domian.com;
  5. rewrite ^(.*) http://domian.com$1 permanent;
  6. }
  7. server {
  8. listen 80 default_server;
  9.  
  10. # access_log off;
  11. access_log /home/domian.com/logs/access.log;
  12. # error_log off;
  13. error_log /home/domian.com/logs/error.log;
  14.  
  15. root /home/domian.com/public_html;
  16. index index.php index.html index.htm;
  17. server_name domian.com;
  18.  
  19. location / {
  20. try_files $uri $uri/ /index.php?$args;
  21. }
  22.  
  23. # Custom configuration
  24. include /home/domian.com/public_html/*.conf;
  25.  
  26. location ~ \.php$ {
  27. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  28. include /etc/nginx/fastcgi_params;
  29. fastcgi_pass 127.0.0.1:9000;
  30. fastcgi_index index.php;
  31. fastcgi_connect_timeout 1000;
  32. fastcgi_send_timeout 1000;
  33. fastcgi_read_timeout 1000;
  34. fastcgi_buffer_size 256k;
  35. fastcgi_buffers 4 256k;
  36. fastcgi_busy_buffers_size 256k;
  37. fastcgi_temp_file_write_size 256k;
  38. fastcgi_intercept_errors on;
  39. fastcgi_param SCRIPT_FILENAME /home/domian.com/public_html$fastcgi_script_name;
  40. }
  41. location /nginx_status {
  42. stub_status on;
  43. access_log off;
  44. }
  45. location /php_status {
  46. fastcgi_pass 127.0.0.1:9000;
  47. fastcgi_index index.php;
  48. fastcgi_param SCRIPT_FILENAME /home/domian.com/public_html$fastcgi_script_name;
  49. include /etc/nginx/fastcgi_params;
  50. }
  51. location ~ /\. {
  52. deny all;
  53. }
  54. location = /favicon.ico {
  55. log_not_found off;
  56. access_log off;
  57. }
  58. location = /robots.txt {
  59. allow all;
  60. log_not_found off;
  61. access_log off;
  62. }
  63. 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)$ {
  64. gzip_static off;
  65. add_header Pragma public;
  66. add_header Cache-Control "public, must-revalidate, proxy-revalidate";
  67. access_log off;
  68. expires 30d;
  69. break;
  70. }
  71.  
  72. location ~* \.(txt|js|css)$ {
  73. add_header Pragma public;
  74. add_header Cache-Control "public, must-revalidate, proxy-revalidate";
  75. access_log off;
  76. expires 30d;
  77. break;
  78. }
  79. }
  80.  
  81. server {
  82. listen 8888;
  83.  
  84. access_log off;
  85. log_not_found off;
  86. error_log /home/domian.com/logs/nginx_error.log;
  87.  
  88. root /home/domian.com/private_html;
  89. index index.php index.html index.htm;
  90. server_name domian.com;
  91.  
  92.  
  93. location / {
  94. try_files $uri $uri/ /index.php;
  95. }
  96.  
  97. location ~ \.php$ {
  98. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  99. include /etc/nginx/fastcgi_params;
  100. fastcgi_pass 127.0.0.1:9000;
  101. fastcgi_index index.php;
  102. fastcgi_connect_timeout 1000;
  103. fastcgi_send_timeout 1000;
  104. fastcgi_read_timeout 1000;
  105. fastcgi_buffer_size 256k;
  106. fastcgi_buffers 4 256k;
  107. fastcgi_busy_buffers_size 256k;
  108. fastcgi_temp_file_write_size 256k;
  109. fastcgi_intercept_errors on;
  110. fastcgi_param SCRIPT_FILENAME /home/domian.com/private_html$fastcgi_script_name;
  111. }
  112.  
  113. location ~ /\. {
  114. deny all;
  115. }
  116. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement