added http redirect

This commit is contained in:
Sergei Poljanski 2023-08-04 23:43:56 +03:00
parent 1e755c7f9e
commit 6e56394961

View file

@ -25,3 +25,22 @@ server {
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
}
server {
listen 80;
listen [::]:80;
server_name asxp.io www.asxp.io;
if ($host = http://$host$request_uri) {
return 301 https://$host$request_uri;
}
if ($host = http://www.$host$request_uri) {
return 301 https://$host$request_uri;
}
location / {
try_files $uri $uri/ =404;
}
}