Welcome to Centmin Mod Community
Become a Member

Nginx How to add parked domain?

Discussion in 'Centmin Mod Insights' started by rdan, Jul 15, 2014.

  1. rdan

    rdan Well-Known Member

    5,439
    1,398
    113
    May 25, 2014
    Ratings:
    +2,187
    Local Time:
    7:25 AM
    Mainline
    10.2
    In Cpanel, it's very easy to do this, Now on Centminmod how can I park a domain?
    Just add another domain on server_name line?

     
  2. eva2000

    eva2000 Administrator Staff Member

    53,530
    12,134
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,677
    Local Time:
    9:25 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Yeah just add another server_name entry on same line for non-https domains. For https existing domains, you might need a separate server level context as the http to https redirect would push parked domains to https (if you have $server_name variable) and if you don't have an SSL certificate with same details as your existing https domain (i.e. multi-domain SSL or multi-domain wildcard SSL needed), it won't work well for the parked domain unless you have a separate https server context for parkedomain.com with it's own separate https/443 vhost and pointing to it's own normal SSL certificate.

    note: parkedomain.com domain would need to have SSL certificate too for below config
    Code:
    server {
      listen 80;
      server_name community.centminmod.com parkedomain.com;
       return 301 https://$server_name$request_uri;
    }
    or you can change $server_name to just the domain with https SSL certificate so non-https parkedomain.com redirects
    Code:
    server {
      listen 80;
      server_name community.centminmod.com parkedomain.com;
       return 301 https://community.centminmod.com$request_uri;
    }
    for non-https normal just

    Code:
    server {
      listen 80;
      server_name community.centminmod.com parkedomain.com;
    }
     
  3. YuchiRO

    YuchiRO Member

    100
    6
    18
    Jan 12, 2015
    Ratings:
    +8
    Local Time:
    6:25 AM
    5.5.4
    Hi

    After parked domain, How to force redirect to parkedomain.com when visitor visit community.centminmod.com ?

    Thanks
     
  4. eva2000

    eva2000 Administrator Staff Member

    53,530
    12,134
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,677
    Local Time:
    9:25 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+