http and http, www and non-www
by Oldy from LinuxQuestions.org on (#57M08)
Hi, there. This is similar to nginx, but that is nginx: 404 Not Found.
I have checked amongst this: good vs bad. There are only 1 secured (https://example.com), but three others are not secured.
Code:server {
listen 80;
root /var/www/html/example.com/public;
index index.php index.html index.htm;
server_name example.com www.example.com;
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
}
include /var/www/html/example.com/.nginx.conf;
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
source:
(Ps, I dont speak English that much)


I have checked amongst this: good vs bad. There are only 1 secured (https://example.com), but three others are not secured.
Code:server {
listen 80;
root /var/www/html/example.com/public;
index index.php index.html index.htm;
server_name example.com www.example.com;
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
}
include /var/www/html/example.com/.nginx.conf;
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
source:
- http://example.com (Chrome/Firefox/etc: not secure)
- http://www.example.com (Chrome/Firefox/etc: not secure)
- https://www.example.com (Chrome/Firefox/etc: not secure)
- (https://example.com (Chrome/Firefox/etc: secure, but the same))
(Ps, I dont speak English that much)