Redirect a domain to https with nginx in Direct Admin

Direct Admin, NGINX, Quick Tip

I always forget how to redirect a domain from http -> https when i'm in Direct Admin. It is pretty easy:

|*if SSL_TEMPLATE="0"|
    return 301 https://|DOMAIN|$request_uri;
|*endif|

Login as admin, go to Custom HTTPD Configurations, find your domain and add the code in the textarea. Click save and reload your nginx configuration. Done. 

Write a comment

Your email address will not be published. Required fields are marked*