Thinhnam.net Configuration Official

# Logs access_log /var/log/nginx/thinhnam.net_access.log; error_log /var/log/nginx/thinhnam.net_error.log;

ErrorLog $APACHE_LOG_DIR/thinhnam_error.log CustomLog $APACHE_LOG_DIR/thinhnam_access.log combined </VirtualHost> Obtain a free Let’s Encrypt certificate:

SSLEngine on SSLCertificateFile /etc/ssl/certs/thinhnam.net/fullchain.pem SSLCertificateKeyFile /etc/ssl/private/thinhnam.net/privkey.pem Thinhnam.net Configuration

server listen 80; listen [::]:80; server_name thinhnam.net www.thinhnam.net; return 301 https://$server_name$request_uri;

# PHP-FPM (if using PHP) location ~ \.php$ include snippets/fastcgi-php.conf; fastcgi_pass unix:/var/run/php/php8.1-fpm.sock; # Logs access_log /var/log/nginx/thinhnam

sudo apt install certbot python3-certbot-nginx # for Nginx # or sudo apt install certbot python3-certbot-apache # for Apache sudo certbot --nginx -d thinhnam.net -d www.thinhnam.net

server listen 443 ssl http2; listen [::]:443 ssl http2; server_name thinhnam.net www.thinhnam.net; # Logs access_log /var/log/nginx/thinhnam.net_access.log

<Directory /var/www/thinhnam.net/html> Options -Indexes +FollowSymLinks AllowOverride All Require all granted </Directory>