Advertisement
Guest User

File Ngix lỗi

a guest
Mar 9th, 2017
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.08 KB | None | 0 0
  1. server {
  2. listen 443 ssl http2;
  3. server_name www.giamcantao.com;
  4.  
  5. # SSL
  6. ssl_certificate /etc/letsencrypt/live/giamcantao.com/fullchain.pem;
  7. ssl_certificate_key /etc/letsencrypt/live/giamcantao.com/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.  
  12. rewrite ^(.*) https://giamcantao.com$1 permanent;
  13. }
  14. server {
  15. listen 80;
  16. server_name giamcantao.com www.giamcantao.com;
  17. rewrite ^(.*) https://giamcantao.com$1 permanent;
  18. }
  19. server {
  20. listen 443 ssl http2;
  21.  
  22. access_log off;
  23. # access_log /home/giamcantao.com/logs/access.log;
  24. error_log off;
  25. # error_log /home/giamcantao.com/logs/error.log;
  26.  
  27. root /home/giamcantao.com/public_html;
  28. index index.php index.html index.htm;
  29. server_name giamcantao.com;
  30.  
  31. # SSL
  32. ssl_certificate /etc/letsencrypt/live/giamcantao.com/fullchain.pem;
  33. ssl_certificate_key /etc/letsencrypt/live/giamcantao.com/privkey.pem;
  34. ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  35. ssl_prefer_server_ciphers on;
  36. ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
  37.  
  38. # Improve HTTPS performance with session resumption
  39. ssl_session_cache shared:SSL:50m;
  40. ssl_session_timeout 1d;
  41. # DH parameters
  42. ssl_dhparam /etc/nginx/ssl/dhparam.pem;
  43.  
  44. # Enable HSTS (https://developer.mozilla.org/en-US/docs/Security/HTTP_Strict_Transport_Security)
  45. add_header Strict-Transport-Security "max-age=31536000" always;
  46.  
  47. location / {
  48. try_files $uri $uri/ /index.php?$args;
  49. }
  50.  
  51. # Custom configuration
  52. include /home/giamcantao.com/public_html/*.conf;
  53.  
  54. location ~ \.php$ {
  55. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  56. include /etc/nginx/fastcgi_params;
  57. fastcgi_pass 127.0.0.1:9000;
  58. fastcgi_index index.php;
  59. fastcgi_connect_timeout 1000;
  60. fastcgi_send_timeout 1000;
  61. fastcgi_read_timeout 1000;
  62. fastcgi_buffer_size 256k;
  63. fastcgi_buffers 4 256k;
  64. fastcgi_busy_buffers_size 256k;
  65. fastcgi_temp_file_write_size 256k;
  66. fastcgi_intercept_errors on;
  67. fastcgi_param SCRIPT_FILENAME /home/giamcantao.com/public_html$fastcgi_script_name;
  68. }
  69. location /nginx_status {
  70. stub_status on;
  71. access_log off;
  72. allow 127.0.0.1;
  73. deny all;
  74. }
  75. location /php_status {
  76. fastcgi_pass 127.0.0.1:9000;
  77. fastcgi_index index.php;
  78. fastcgi_param SCRIPT_FILENAME /home/giamcantao.com/public_html$fastcgi_script_name;
  79. include /etc/nginx/fastcgi_params;
  80. allow 127.0.0.1;
  81. deny all;
  82. }
  83. location ~ /\. {
  84. deny all;
  85. }
  86. location = /favicon.ico {
  87. log_not_found off;
  88. access_log off;
  89. }
  90. location = /robots.txt {
  91. allow all;
  92. log_not_found off;
  93. access_log off;
  94. }
  95. 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|sv$
  96. gzip_static off;
  97. add_header Pragma public;
  98. add_header Cache-Control "public, must-revalidate, proxy-revalidate";
  99. access_log off;
  100. expires 30d;
  101. break;
  102. }
  103.  
  104. location ~* \.(txt|js|css)$ {
  105. add_header Pragma public;
  106. add_header Cache-Control "public, must-revalidate, proxy-revalidate";
  107. access_log off;
  108. expires 30d;
  109. break;
  110. }
  111. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement