简体   繁体   中英

nginx ssl subdomain error

Hello i have 2 problem with subdomain

  • my ssl not work for sub.domain.com but work for domain.com

  • phpmyadmin give me a blank page

I have already test many configuration but always i have "no input file specified" error or 502 bad getaway error or blank page

My folder is like

/www/
  - /website/ <- first site
  - /tools/ <- subdomain
     - phpmyadmin (symlink of /usr/share/phpmyadmin)

Config

server {
        listen 80;
        listen 443 ssl;

       ssl on;
       ssl_certificate /www/website/ssl/domain_com.pem;
       ssl_certificate_key /www/website/ssl/domain_com.key;

       ssl_session_timeout 5m;

        ssl_protocols SSLv2 TLSv1 TLSv1.1 TLSv1.2;
        ssl_prefer_server_ciphers on;
        ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;

        disable_symlinks off;
        root /www/tools/;
        server_name configuration.domain.com;
        index index.php index.html index.htm;

location /phpmyadmin {
    index index.php index.htm;
    root /usr/share;
}

location ~* \.php$ {
    include fastcgi_params;
    fastcgi_pass   unix:/var/run/php5-fpm.sock;
}
}

Im on Debian 7, Nginx 1.8

Thanks you

You should set root based on the location you are setting, because the location will not be appended to that, so you should fix this block:

location /phpmyadmin {
    index index.php index.htm;
    root /usr/share/phpmyadmin;
}

Please confirm if you have single domain certificate, a wildcard certificate or multi domain certificate.

If you are using a single domain certificate (say abc.com) it will not work for xyz.abc.com or 123.abc.com. It will work for only abc.com

If you have procured a wildcard certificate , please check and confirm if the subdomain is a first level sub domain or second level sub domain. wildcard certificates secures only first level sub domain. So *.abc.com certificate will work for 123.abc.com, xyz.abc.com . But it will not work for 123.xyz.abc.com.

If you have procured a multi domain certificate, then check if the sub domain URL is added as SAN to the certificate.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM