简体   繁体   English

Nginx SSL子域错误

[英]nginx ssl subdomain error

Hello i have 2 problem with subdomain 您好,我对子域有2个问题

  • my ssl not work for sub.domain.com but work for domain.com 我的SSL不适用于sub.domain.com,但适用于domain.com

  • phpmyadmin give me a blank page phpmyadmin给我一个空白页

I have already test many configuration but always i have "no input file specified" error or 502 bad getaway error or blank page 我已经测试了许多配置,但始终出现“未指定输入文件”错误或502错误的错误或空白页

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 我在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: 您应该根据要设置的位置设置root ,因为该位置不会附加到该位置,因此应修复此块:

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. 如果您使用的是单个域证书(例如abc.com),则它不适用于xyz.abc.com或123.abc.com。 It will work for only abc.com 仅适用于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 . 因此* .abc.com证书将适用于123.abc.com,xyz.abc.com。 But it will not work for 123.xyz.abc.com. 但它不适用于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. 如果您已购买了多域证书,请检查是否将子域URL作为SAN添加到证书中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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