server { listen 80; server_name work.bestprint.vn ; rewrite ^(.*) https://work.bestprint.vn$1 permanent; } server { listen 443 ssl http2; ssl_certificate /etc/nginx/auth-acme/work.bestprint.vn/work.bestprint.vn.crt; ssl_certificate_key /etc/nginx/auth-acme/work.bestprint.vn/work.bestprint.vn.key; ssl_session_cache shared:SSL:10m; ssl_session_timeout 10m; ssl_prefer_server_ciphers on; include /etc/nginx/conf/ssl-protocol-cipher.conf; ssl_stapling on; ssl_stapling_verify on; resolver 8.8.8.8 8.8.4.4 valid=300s; resolver_timeout 30s; ssl_trusted_certificate /etc/nginx/auth-acme/work.bestprint.vn/work.bestprint.vn.ca; ssl_buffer_size 1400; ssl_session_tickets on; add_header Strict-Transport-Security max-age=31536000; access_log off; access_log /home/work.bestprint.vn/logs/access_log; error_log off; error_log /home/work.bestprint.vn/logs/error.log; add_header X-Frame-Options SAMEORIGIN; add_header X-Content-Type-Options nosniff; add_header X-XSS-Protection "1; mode=block"; root /home/work.bestprint.vn/public_html; include /etc/nginx/conf/ddos2.conf; index index.php index.html index.htm; server_name work.bestprint.vn; #/////////////////////////////////////////////////////// # Ban chi co the chon 1 trong 4 rule AAA, BBB, CCC, DDD hoac EEE # Ban nen comment cac rule khong su dung thay vi xoa chung vi neu ban su dung wordpress blog # Cac dong nay can thiet cho cac chuc nang trong Wordpress Blog Tools cua VPSSIM # Thuat ngu: # Comment - Them dau # vao truoc # Uncomment - Bo dau # o truoc cau. #/////////////////////////////////////////////////////// #Chay tat ca cac website (Wordpress, Xenforo, Joomla, Phpbb .... ). neu ban su dung rule cua ban,comment dong duoi (them dau # vao truoc) (AAA) include /etc/nginx/conf/all.conf; #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) #location / { #Uncomment 3 dong nay, sau do cho rule cua ban vao day! #} # 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) #include /etc/nginx/conf/supercache.conf; # 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) #include /etc/nginx/conf/w3total.conf; # Rule cho wordpress + WP-Rocket. Neu ban su dung wordpress va WP-Rocket, uncomment dong duoi va comment dong AAA phia tren. (EEE) #include /etc/nginx/conf/wprocket.conf; # Config Cache Static Files include /etc/nginx/conf/staticfiles.conf; #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. #Khong duoc xoa dong duoi, neu xoa VPSSIM se khong hoat dong ! #include /etc/nginx/conf/block.conf; # Config for Free SSL (LetEncrypt) - Do not Delete ! location ~ /.well-known { allow all; root /home/work.bestprint.vn/public_html; } # Error Page #error_page 403 /errorpage_html/403.html; #error_page 404 /errorpage_html/404.html; #error_page 405 /errorpage_html/405.html; #error_page 502 /errorpage_html/502.html; #error_page 503 /errorpage_html/503.html; #error_page 504 /errorpage_html/504.html; #location ^~ /errorpage_html/ { # internal; # root /home/work.bestprint.vn; # access_log off; #} location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.+)$; include /etc/nginx/fastcgi_params; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_connect_timeout 250; fastcgi_send_timeout 250; fastcgi_read_timeout 250; fastcgi_buffer_size 256k; fastcgi_buffers 4 256k; fastcgi_busy_buffers_size 256k; fastcgi_temp_file_write_size 256k; fastcgi_intercept_errors on; fastcgi_param SCRIPT_FILENAME /home/work.bestprint.vn/public_html$fastcgi_script_name; } #include /etc/nginx/conf/phpstatus.conf; include /etc/nginx/conf/drop.conf; }