Rất đơn giản để sửa lỗi không truy cập vào port khi cài ssl vào domain chính trong hocvps.
Bạn chỉ cần thêm đoạn code sau vào file zubi.cloud.conf theo đường dẫn sau:
/etc/nginx/conf.d/zubi.cloud.conf
Đoạn code cần thêm:
server {
listen 2018 ssl;
access_log off;
log_not_found off;
error_log /home/zubi.cloud/logs/nginx_error.log;
root /home/zubi.cloud/private_html;
index index.php index.html index.htm;
server_name zubi.cloud;
error_page 497 https://$server_name:$server_port$request_uri;
ssl_certificate /etc/letsencrypt/live/zubi.cloud/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/zubi.cloud/privkey.pem;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
auth_basic "Restricted";
auth_basic_user_file /home/zubi.cloud/private_html/hocvps/.htpasswd;
location / {
autoindex on;
try_files $uri $uri/ /index.php;
}
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 1000;
fastcgi_send_timeout 1000;
fastcgi_read_timeout 1000;
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/zubi.cloud/private_html$fastcgi_script_name;
}
location ~ /\. {
deny all;
}
}