Get the most out of your Centmin Mod LEMP stack
Become a Member

Nginx How to add parked domain?

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

  1. rdan

    rdan Premium Member Premium Member

    4,197
    1,016
    113
    May 25, 2014
    Ratings:
    +1,440
    Local Time:
    3:59 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

    34,649
    7,658
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +11,776
    Local Time:
    5:59 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    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;
    }
     
    • Like Like x 1
  3. YuchiRO

    YuchiRO Member

    98
    6
    8
    Jan 12, 2015
    Ratings:
    +8
    Local Time:
    2:59 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

    34,649
    7,658
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +11,776
    Local Time:
    5:59 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
..