Advertisement
Guest User

Untitled

a guest
Apr 27th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.75 KB | None | 0 0
  1. server {
  2. listen 443 ssl http2;
  3. server_name www.tinhdau24.net;
  4.  
  5. # SSL
  6. ssl_certificate /etc/letsencrypt/live/tinhdau24.net/fullchain.pem;
  7. ssl_certificate_key /etc/letsencrypt/live/tinhdau24.net/privkey.pem;
  8. ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  9. ssl_prefer_server_ciphers on;
  10. ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
  11. rewrite ^(.*) https://www.tinhdau24.net$1 permanent;
  12. }
  13. server {
  14. listen 80;
  15. server_name www.tinhdau24.net tinhdau24.net;
  16. rewrite ^(.*) https://www.tinhdau24.net$1 permanent;
  17. }
  18. server {
  19. listen 443 ssl http2;
  20.  
  21. access_log off;
  22. # access_log /home/tinhdau24.net/logs/access.log;
  23. error_log off;
  24. # error_log /home/tinhdau24.net/logs/error.log;
  25.  
  26. root /home/tinhdau24.net/public_html;
  27. index index.php index.html index.htm;
  28. server_name www.tinhdau24.net;
  29.  
  30. # SSL
  31. ssl_certificate /etc/letsencrypt/live/tinhdau24.net/fullchain.pem;
  32. ssl_certificate_key /etc/letsencrypt/live/tinhdau24.net/privkey.pem;
  33. ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  34. ssl_prefer_server_ciphers on;
  35. ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
  36.  
  37. # Improve HTTPS performance with session resumption
  38. ssl_session_cache shared:SSL:50m;
  39. ssl_session_timeout 1d;
  40.  
  41. # DH parameters
  42. ssl_dhparam /etc/nginx/ssl/dhparam.pem;
  43. # Enable HSTS
  44. add_header Strict-Transport-Security "max-age=31536000" always;
  45.  
  46. location / {
  47. try_files $uri $uri/ /index.php?$args;
  48. }
  49.  
  50. # Custom configuration
  51. include /home/tinhdau24.net/public_html/*.conf;
  52.  
  53. location ~ \.php$ {
  54. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  55. include /etc/nginx/fastcgi_params;
  56. fastcgi_pass 127.0.0.1:9000;
  57. fastcgi_index index.php;
  58. fastcgi_connect_timeout 1000;
  59. fastcgi_send_timeout 1000;
  60. fastcgi_read_timeout 1000;
  61. fastcgi_buffer_size 256k;
  62. fastcgi_buffers 4 256k;
  63. fastcgi_busy_buffers_size 256k;
  64. fastcgi_temp_file_write_size 256k;
  65. fastcgi_intercept_errors on;
  66. fastcgi_param SCRIPT_FILENAME /home/tinhdau24.net/public_html$fastcgi_script_name;
  67. }
  68. location /nginx_status {
  69. stub_status on;
  70. access_log off;
  71. allow 127.0.0.1;
  72. deny all;
  73. }
  74. location /php_status {
  75. fastcgi_pass 127.0.0.1:9000;
  76. fastcgi_index index.php;
  77. fastcgi_param SCRIPT_FILENAME /home/tinhdau24.net/public_html$fastcgi_script_name;
  78. include /etc/nginx/fastcgi_params;
  79. allow 127.0.0.1;
  80. deny all;
  81. }
  82. location ~ /\. {
  83. deny all;
  84. }
  85. location = /favicon.ico {
  86. log_not_found off;
  87. access_log off;
  88. }
  89. location = /robots.txt {
  90. allow all;
  91. log_not_found off;
  92. access_log off;
  93. }
  94. 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)$ {
  95. gzip_static off;
  96. add_header Pragma public;
  97. add_header Cache-Control "public, must-revalidate, proxy-revalidate";
  98. access_log off;
  99. expires 30d;
  100. break;
  101. }
  102.  
  103. location ~* \.(txt|js|css)$ {
  104. add_header Pragma public;
  105. add_header Cache-Control "public, must-revalidate, proxy-revalidate";
  106. access_log off;
  107. expires 30d;
  108. break;
  109. }
  110. }
  111.  
  112. server {
  113. listen 5555 ssl http2;
  114. access_log off;
  115. log_not_found off;
  116. error_log off;
  117. root /home/tinhdau24.net/private_html;
  118. index index.php index.html index.htm;
  119. server_name www.tinhdau24.net;
  120. error_page 497 https://$host:5555$request_uri;
  121. # SSL
  122. ssl_certificate /etc/letsencrypt/live/tinhdau24.net/fullchain.pem;
  123. ssl_certificate_key /etc/letsencrypt/live/tinhdau24.net/privkey.pem;
  124. ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  125. ssl_prefer_server_ciphers on;
  126. ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
  127.  
  128. auth_basic "Restricted";
  129. auth_basic_user_file /home/tinhdau24.net/private_html/hocvps/.htpasswd;
  130.  
  131. location / {
  132. try_files $uri $uri/ /index.php;
  133. }
  134.  
  135. location ~ \.php$ {
  136. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  137. include /etc/nginx/fastcgi_params;
  138. fastcgi_pass 127.0.0.1:9000;
  139. fastcgi_index index.php;
  140. fastcgi_connect_timeout 1000;
  141. fastcgi_send_timeout 1000;
  142. fastcgi_read_timeout 1000;
  143. fastcgi_buffer_size 256k;
  144. fastcgi_buffers 4 256k;
  145. fastcgi_busy_buffers_size 256k;
  146. fastcgi_temp_file_write_size 256k;
  147. fastcgi_intercept_errors on;
  148. fastcgi_param SCRIPT_FILENAME /home/tinhdau24.net/private_html$fastcgi_script_name;
  149. }
  150.  
  151. location ~ /\. {
  152. deny all;
  153. }
  154. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement