I have this in the first block of my (nginx) "Custom HTTPD Configurations" for the hostname domain:
It is to redirect all traffic on port 80 to 443/https. This worked exactly as expected until yesterday, when I upgraded DA to 1.5 and enabled LetsEncrypt. I now get the following error:
So I removed the "listen" line, and all is well. I see that there's a "server" block in nginx-vhosts.conf which matches the same conditions. So I'm wondering: was it there before 1.5, or is this new? What *is* the best way to redirect to https in a HSTS setup in DirectAdmin? (I have the require HSTS options added through CUSTOM3 using |*if SSL_TEMPLATE="1"|).
Code:
|*if SSL_TEMPLATE="0"|
# # # # # # # # # # # # # # # # # # # #
listen xxx.xxx.xxx.xxx:80;
return 301 https://$server_name$request_uri;
# # # # # # # # # # # # # # # # # # # #
|*endif|
It is to redirect all traffic on port 80 to 443/https. This worked exactly as expected until yesterday, when I upgraded DA to 1.5 and enabled LetsEncrypt. I now get the following error:
Code:
nginx: [emerg] a duplicate listen xxx.xxx.xxx.xxx:80 in
/usr/local/directadmin/data/users/admin1/nginx.conf:16
So I removed the "listen" line, and all is well. I see that there's a "server" block in nginx-vhosts.conf which matches the same conditions. So I'm wondering: was it there before 1.5, or is this new? What *is* the best way to redirect to https in a HSTS setup in DirectAdmin? (I have the require HSTS options added through CUSTOM3 using |*if SSL_TEMPLATE="1"|).