Guest User

OldtoNew

a guest
Nov 25th, 2020
49
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. server {
  2. listen 80;
  3. server_name olddomain.com www.olddomain.com;
  4. return 301 https://olddomain.com$request_uri;
  5. }
  6.  
  7. server {
  8. server_name .olddomain.com;
  9. return 301 http://newdomain.io$request_uri;
  10. }
  11.  
  12. server {
  13. listen 443 ssl http2;
  14. server_name www.olddomain.com;
  15. return 301 https://olddomain.com$request_uri;
  16. ssl_certificate /etc/nginx/auth-acme/olddomain.com/olddomain.com.crt;
  17. ssl_certificate_key /etc/nginx/auth-acme/olddomain.com/olddomain.com.key;
  18. ssl_trusted_certificate /etc/nginx/auth-acme/olddomain.com/olddomain.com.ca;
  19. }
  20. server {
  21. listen 443 ssl http2;
  22. ssl_certificate /etc/nginx/auth-acme/olddomain.com/olddomain.com.crt;
  23. ssl_certificate_key /etc/nginx/auth-acme/olddomain.com/olddomain.com.key;
  24. ssl_session_cache shared:SSL:10m;
  25. ssl_session_timeout 10m;
  26. ssl_prefer_server_ciphers on;
  27. include /etc/nginx/conf/ssl-protocol-cipher.conf;
  28. ssl_stapling on;
  29. ssl_stapling_verify on;
  30. resolver 8.8.8.8 8.8.4.4 valid=300s;
  31. resolver_timeout 30s;
  32. ssl_trusted_certificate /etc/nginx/auth-acme/olddomain.com/olddomain.com.ca;
  33. ssl_buffer_size 1400;
  34. ssl_session_tickets on;
  35. add_header Strict-Transport-Security max-age=31536000;
  36. access_log off;
  37. access_log /home/olddomain.com/logs/access_log;
  38. error_log off;
  39. error_log /home/olddomain.com/logs/error.log;
  40. add_header X-Frame-Options SAMEORIGIN;
  41. add_header X-Content-Type-Options nosniff;
  42. add_header X-XSS-Protection "1; mode=block";
  43. root /home/olddomain.com/public_html;
  44. include /etc/nginx/conf/ddos2.conf;
  45. index index.php index.html index.htm;
  46. server_name olddomain.com;
  47.  
  48. #///////////////////////////////////////////////////////
  49. # Ban chi co the chon 1 trong 4 rule AAA, BBB, CCC, DDD hoac EEE
  50. # Ban nen comment cac rule khong su dung thay vi xoa chung vi neu ban su dung wordpress blog
  51. # Cac dong nay can thiet cho cac chuc nang trong Wordpress Blog Tools cua VPSSIM
  52. # Thuat ngu:
  53. # Comment - Them dau # vao truoc
  54. # Uncomment - Bo dau # o truoc cau.
  55. #///////////////////////////////////////////////////////
  56.  
  57.  
  58. #Chay tat ca cac website (Wordpress, Xenforo, Joomla, Phpbb .... ). neu ban su dung rule cua ban,comment dong duoi (them dau # vao truoc) (AAA)
  59. include /etc/nginx/conf/all.conf;
  60.  
  61. #Neu ban su dung rule cua minh, comment rule o tren. Sau do uncoment (bo dau # ba dong duoi) sau do them rule vao giua. (BBB)
  62. #location / {
  63. #Uncomment 3 dong nay, sau do cho rule cua ban vao day!
  64. #}
  65.  
  66. # Rule cho wordpress + Plugin wp super cache. Neu ban su dung wordpress va wp super cache, uncomment dong duoi va comment dong AAA phia tren. (CCC)
  67. #include /etc/nginx/conf/supercache.conf;
  68.  
  69. # Rule cho wordpress + Plugin W3 Total Cache. Neu ban su dung wordpress va W3 Total, uncomment dong duoi va comment dong AAA phia tren. (DDD)
  70. #include /etc/nginx/conf/w3total.conf;
  71.  
  72. # Rule cho wordpress + WP-Rocket. Neu ban su dung wordpress va WP-Rocket, uncomment dong duoi va comment dong AAA phia tren. (EEE)
  73. #include /etc/nginx/conf/wprocket.conf;
  74.  
  75. # Config Cache Static Files
  76. include /etc/nginx/conf/staticfiles.conf;
  77.  
  78. #Tang bao mat security, chong sql injection ....(uncoment neu ban muon su dung). Boi vi mot so code website khong su dung duoc voi rule nay, nen mac dinh VPSSIM de tat.
  79. #Khong duoc xoa dong duoi, neu xoa VPSSIM se khong hoat dong !
  80. #include /etc/nginx/conf/block.conf;
  81.  
  82. # Config for Free SSL (LetEncrypt) - Do not Delete !
  83. location ~ /.well-known {
  84. allow all;
  85. root /home/olddomain.com/public_html;
  86. }
  87.  
  88. # Error Page
  89. #error_page 403 /errorpage_html/403.html;
  90. #error_page 404 /errorpage_html/404.html;
  91. #error_page 405 /errorpage_html/405.html;
  92. #error_page 502 /errorpage_html/502.html;
  93. #error_page 503 /errorpage_html/503.html;
  94. #error_page 504 /errorpage_html/504.html;
  95. #location ^~ /errorpage_html/ {
  96. # internal;
  97. # root /home/olddomain.com;
  98. # access_log off;
  99. #}
  100. location ~ \.php$ {
  101. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  102. include /etc/nginx/fastcgi_params;
  103. fastcgi_pass 127.0.0.1:9000;
  104. fastcgi_index index.php;
  105. fastcgi_connect_timeout 250;
  106. fastcgi_send_timeout 250;
  107. fastcgi_read_timeout 250;
  108. fastcgi_buffer_size 256k;
  109. fastcgi_buffers 4 256k;
  110. fastcgi_busy_buffers_size 256k;
  111. fastcgi_temp_file_write_size 256k;
  112. fastcgi_intercept_errors on;
  113. fastcgi_param SCRIPT_FILENAME /home/olddomain.com/public_html$fastcgi_script_name;
  114. }
  115.  
  116. #include /etc/nginx/conf/phpstatus.conf;
  117. include /etc/nginx/conf/drop.conf;
  118.  
  119. }
  120.  
RAW Paste Data