Advertisement
Guest User

Untitled

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