Ubuntu 14.04 + Nginx + PHP5.5-FPM + MariaDB

를 세팅하여 사용중입니다.

 

클라우드플레어를 사용중이고,

우분투에서 Let’s Encrypt 인증서 발급까지 완료 후 

 

server {
    listen       80;
    server_name  mydomain.com www.mydomain.com;
 
    return       301 https://$server_name$request_uri;
}
 
 
server {
    listen       443 ssl http2;
    server_name  mydomain.com www.mydomain.com;
    root   /home/username/www;
    client_max_body_size 10M;
 
    ssl_certificate "/etc/letsencrypt/live/mydomain.com/fullchain.pem";
    ssl_certificate_key "/etc/letsencrypt/live/mydomain.com/privkey.pem";
    ssl_dhparam "/etc/ssl/certs/dhparam.pem";
     
    # Enable HSTS. This forces SSL on clients that respect it, most modern browsers. The includeSubDomains flag is optional.
    add_header Strict-Transport-Security "max-age=31536000";
     
    # Set caches, protocols, and accepted ciphers. This config will merit an A+ SSL Labs score.
    ssl_session_cache shared:SSL:20m;
    ssl_session_timeout 10m;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_prefer_server_ciphers on;
    ssl_ciphers 'ECDH+AESGCM:ECDH+AES256:ECDH+AES128:DH+3DES:!ADH:!AECDH:!MD5';
     
    access_log /var/log/nginx/mydomain.com.access.log;
    error_log  /var/log/nginx/mydomain.com.error.log warn;
 
    location / {
        index  index.php index.html;
        try_files $uri $uri/ /index.php?$args;
    }
 
    # Allow Lets Encrypt Domain Validation Program
    #location ^~ /.well-known/acme-challenge/ {
    #    allow all;
    #}
 
    # Block dot file (.htaccess .htpasswd .svn .git .env and so on.)
    location ~ /\. {
        deny all;
    }
 
    # Block (log file, binary, certificate, shell script, sql dump file) access.
    location ~* \.(log|binary|pem|enc|crt|conf|cnf|sql|sh|key)$ {
        deny all;
    }
 
    # Block access
    location ~* (composer\.json|contributing\.md|license\.txt|readme\.rst|readme\.md|readme\.txt|copyright|artisan|gulpfile\.js|package\.json|phpunit\.xml)$ {
        deny all;
    }
 
    location = /favicon.ico {
        log_not_found off;
        access_log off;
    }
 
    location = /robots.txt {
        log_not_found off;
        access_log off;
    }
 
    # Block .php file inside upload folder. uploads(wp), files(drupal, xe), data(gnuboard).
    location ~* /(?:uploads|files|data)/.*\.php$ {
        deny all;
    }
 
    # Add PHP handler
    location ~ [^/]\.php(/|$) {
        fastcgi_split_path_info ^(.+?\.php)(/.*)$;
        if (!-f $document_root$fastcgi_script_name) {
            return 404;
        }
 
        fastcgi_pass unix:/run/php/username.sock;
        fastcgi_index index.php;
        include fastcgi_params;
    }
}

 

/etc/nginx/conf.d/mydomain.com.conf

으로 작성해주고 서버재부팅을 하면

클라우드플레어 서버다운 화면이 출력되며 접속이 불가합니다.

몇번을 반복해봐도 웹이 안 열리네요.

conf 파일상으로 잘못된 부분이 있는걸까요???

 

클라우드 Crypto 부분에서 따로 건드려야 하는 설정이 있는지요?

  • profile

    클플과 관련이 있을 가능성: 5%

    Let's Encrypt와 관련이 있을 가능성: 2%

    서버 설정이 잘못되었을 가능성: 93%

     

    /var/log/nginx/error.log 파일을 뒤져보세요. http2를 지원하지 않는 구버전 nginx이거나, 설정파일에 문법 오류가 있거나, 대략 이런 이유로 에러메시지가 남아 있을 거예요. 그게 아니라면 방화벽에서 443 포트가 닫혀 있을지도...

     

    그리고 클플을 사용하면 무슨 인증서를 사용하더라도 클플에서 무료로 제공하는 인증서로 바꿔치기됩니다.

  • ?
    에러로그를 한번 보겠습니다.
    클라우드플레어를 사용하면 다른인증서를 사용 못하는거군요
    답변 감사드립니다. ^^