Nginx + pointers only work on http.

rpr

Verified User
Joined
Oct 20, 2010
Messages
65
Hi,

I have a domain.com which has a certificate (Lets encrypt)
for:
  • domain.com
  • aaaaaa.com
  • bbbbbb.com

Domain.com is the primairy domain and
  • aaaaaa.com
  • bbbbbb.com
Are pointers to domain.com

http://aaaaaa.com points to http://domain.com
but https://aaaaaaa.com give me a cert error because it is using the default certificate instead of the lets encrypt one.

Anyone has an idea how to fix this?
 
Hello,

Pointer in Directadmin do have only sections for HTTP, they do not have sections for HTTPS. So you need to update template:

1. copy /usr/local/directadmin/data/templates/nginx_server_redirect.conf to /usr/local/directadmin/data/templates/custom/nginx_server_redirect.conf

2. update /usr/local/directadmin/data/templates/custom/nginx_server_redirect.conf
with your instructions

3. rewrite configs with
Code:
./build rewrite_confs

Check /usr/local/directadmin/data/templates/nginx_server_secure.conf for more examples.


or... user Aliases (not pointers) and redirect with if..then... in NGINX config for a server.


p.s. the guide is not full, it contains only general ideas, it's up to you to complete it by searching more details on each step.
 
Tried your solution but I am stuck at the fact that |CERT| isn't replaced correctly in this file.
I made my custom/nginx_server_redirect.conf file to this:
Code:
server
{
        listen |IP|:|PORT_80|;
        |MULTI_IP|
        server_name |POINTER| www.|POINTER|;
        rewrite     ^ http://www.|DOMAIN|$request_uri? permanent;
}
server
{

        listen |IP|:|PORT_443| ssl http2;
        |MULTI_IP|
        server_name |POINTER| www.|POINTER|;
        ssl on;
        ssl_certificate |CERT|;
        ssl_certificate_key |KEY|;
        rewrite     ^ https://www.|DOMAIN|$request_uri? permanent;
}

The error after building the configs is:
nginx: [emerg] BIO_new_file("/etc/nginx/|CERT|") failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/etc/nginx/|CERT|','r') error:20...le:no such file)
 
Back
Top