Want to subscribe to topics you're interested in?
Become a Member

Nginx Getting confused about nginx config files

Discussion in 'Install & Upgrades or Pre-Install Questions' started by Derek, May 6, 2018.

  1. Derek

    Derek Member

    43
    9
    8
    Aug 5, 2016
    Ratings:
    +21
    Local Time:
    11:27 AM
    So, I bought a new domain for a new forum, configured it, set up cloudflare, and everything works.

    The problem is that I bought the .net, .com, .org package, and I'm trying to have one virtual host respond requests and redirect appropriately from www.mydomain.net, mydomain.net, www.mydomain.org, mydomain,org, and so on.

    So I'm looking in the mydomain.tld.ssl.conf file thinking I can just list the alternate names in the server_name field, but it's listed twice and I can't figure out which is important, or if they both are, or...


    #x# HTTPS-DEFAULT
    server {

    server_name mydomain.tld www.mydomain.tld;
    return 302 https://mydomain.tld$request_uri;
    include /usr/local/nginx/conf/staticfiles.conf;
    }

    # listen 80;
    # server_name mydomain.tld www.mydomain.tld;
    # return 302 https://$server_name$request_uri;

    server {
    listen 443 ssl http2;
    server_name mydomain.tld www.mydomain.tld;

    include /usr/local/nginx/conf/ssl/mydomain.tld/mydomain.tld.crt.key.conf;
    include /usr/local/nginx/conf/ssl_include.conf;

    # cloudflare authenticated origin pull cert community.centminmod.com/threads/13847/
    #ssl_client_certificate /usr/local/nginx/conf/ssl/cloudflare/mydomain.tld/origin.crt;
    #ssl_verify_client on;
    http2_max_field_size 16k;
    http2_max_header_size 32k;
    ...

    (I know, I should use code here but I wanted the boldface to work.)

    Where's the right place to list the domains I want to direct from?
     
  2. JJC84

    JJC84 Premium Member Premium Member

    151
    67
    28
    Jan 31, 2018
    Ratings:
    +92
    Local Time:
    10:27 AM
    1.13.9
    10.1
  3. JoeDer

    JoeDer New Member

    26
    8
    3
    Feb 22, 2015
    Ratings:
    +21
    Local Time:
    6:27 PM
    Nginx 1.13.x
    MariaDB 10.1.x
    • Like Like x 1
  4. Derek

    Derek Member

    43
    9
    8
    Aug 5, 2016
    Ratings:
    +21
    Local Time:
    11:27 AM
    Thanks, folks.

    :)
     
..