Join the community today
Register Now

Nginx How to add parked domain?

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

  1. RoldanLT

    RoldanLT Well-Known Member

    3,829
    929
    113
    May 25, 2014
    Phillipines
    Ratings:
    +1,258
    Local Time:
    6:53 AM
    1.11
    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

    29,016
    6,585
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,775
    Local Time:
    8:53 AM
    Nginx 1.13.x
    MariaDB 5.5
    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

    92
    6
    8
    Jan 12, 2015
    Ratings:
    +8
    Local Time:
    5:53 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

    29,016
    6,585
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,775
    Local Time:
    8:53 AM
    Nginx 1.13.x
    MariaDB 5.5