@kadin
To set HTTPS as the default protocol on Nginx, you can follow these steps:
1 2 3 4 5 6 7 8 9 |
server { listen 443 ssl default_server; server_name example.com; ssl_certificate /path/to/fullchain.pem; ssl_certificate_key /path/to/privkey.pem; // other SSL/TLS settings such as SSL protocols and ciphers } |
Replace example.com
with your domain name and provide the correct paths to your SSL certificate files.
1 2 3 4 5 |
server { listen 80 default_server; server_name example.com; return 301 https://$host$request_uri; } |
1
|
sudo systemctl reload nginx |
Now, HTTPS should be set as the default protocol on your Nginx server. Make sure to test your HTTPS configuration using SSL testing tools to ensure it's properly configured and secure.