SREãã¼ã ã®å°æï¼ãï¼ã§ãã
BASEã§ã¯ç¬èªãã¡ã¤ã³ã§éç¨ããã¦ããã·ã§ããããã§HTTPSã§è¡¨ç¤ºã§ããæ©è½ãå®è£ ãã¾ããã
å»å¹´ã®3æã«ãµããã¡ã¤ã³ã§éç¨ããã¦ããã·ã§ããããã«é¢ãã¦ã¯å ¨ã¦HTTPSåã¯å®è£ ãã¦ãã¾ããããç¬èªãã¡ã¤ã³ã§è¡¨ç¤ºããã¦ããã·ã§ããããã¯HTTPã®è¡¨ç¤ºã®ã¾ã¾ã§ãããä»åããç¬èªãã¡ã¤ã³ãå©ç¨ããã¦ããã·ã§ãããããHTTPSã§ã¢ã¯ã»ã¹ãå¯è½ã¨ãªããå ¨ã¦ã®ã·ã§ããããã§HTTPSã§ã®ã¢ã¯ã»ã¹ãå¯è½ã¨ãªãã¾ãã
ä»åã®æ©è½ã§ã¯HTTPSã¢ã¯ã»ã¹ã«å¿ è¦ãªè¨¼ææ¸ã®åå¾ã¯ç¡æã§è¡ãããã¤ç®¡çã¯åãã¡ãããã¾ãã®ã§ã·ã§ããããã®æ¹ã§è¨¼ææ¸ã®åå¾ã»ç®¡çã¯ä¸è¦ã§ãã
å©ç¨æ¹æ³ãªã©ã¯ããã¥ã¢ã«ã«ãä»»ãããä»åã¯è£å´ã®å®è£ ã«ã¤ãã¦ç´¹ä»ãã¾ã
証ææ¸
ä»å証ææ¸ãçºè¡ããã«ããããLetâs Encryptãå©ç¨ããã¦ããã ãã¾ãããLetâs Encryptã¯å»å¹´ãµã¼ãã¹ãéå§ãããç¡æã§è¨¼ææ¸ãåå¾ã§ãããµã¼ãã¹ã§ãã
ãã åæã«ä½æãç¡å¶éã«åå¾ã§ããããã§ã¯ãªããããã¤ãã®å¶éãåå¨ãã¦ãã¾ããéã«å¶éãããã¡ãã¨å®ãã°åãã¢ã«ã¦ã³ãããã§ããã°è¨¼ææ¸ãè¤æ°æåå¾ãããã¨ã¯è¨±å¯ããã¦ããããã§ããï¼éå¶ã«åãåããæ¸ã¿ï¼
ãã® Letâs Encryptããçºè¡ããã証ææ¸ã使ããã¨ã§ãBASEã®ç¬èªãã¡ã¤ã³ã®ã·ã§ãããhttpsã§ã¢ã¯ã»ã¹ãããã¨ãå¯è½ã«ãã¦ãã¾ãã
å¤é¨ãµã¼ãã¹ã¨ã®é£æº
åå¾ã¯Amazon SQSã¨é£æºããåå¾å°ç¨ã®ãã¼ã¢ã³ãèªåã§è¡ãªã£ã¦ãã¾ãã Letâs Encryptã¯ååã¯ACMEã¢ã«ã¦ã³ãã¨å¼ã°ããå°ç¨ã®ã¢ã«ã¦ã³ããå¿ è¦ã§ãããã®ã¢ã«ã¦ã³ãã証ææ¸ãåå¾ããéã«èªè¨¼ã¨ãã¦ä½¿ããã¾ãã
PHPcon2016ã§çºè¡¨ããè³æã§ãã話ãã¾ããããBASEã®ãµã¼ãã¹ã¯ãã¼ããã©ã³ãµã¼ã«è¤æ°å°ã®nginxã使ã£ã¦ãã¾ããä»åã¯nginxã®è¨å®ãä¸é¨å¤æ´ããLetâs Encryptããã®acme challengeã¨å¼ã°ãã証ææ¸åå¾ç¢ºèªã®ã¢ã¯ã»ã¹ãããããåå¾å°ç¨ã®ãµã¼ãã«ãããã·ããããã«ãã¾ããã
åå¾å°ç¨ãµã¼ãã§ã¯acme challengeã¢ã¯ã»ã¹ã®åãç¿ã¨ãã¦ãã¡ã¤ã³ãã¨ã«ãã£ã¬ã¯ããªãä½æãã¬ã¹ãã³ã¹ãè¿ãã¦ãã¾ããç´ä¸ã§èªè¨¼ãè¡ãããã¨è¨¼ææ¸ãåå¾ããããã®ä¸é£ã®åä½ãå°ç¨ã®ãã¼ã¢ã³ã«ãã£ã¦è¡ãããä»çµã¿ã§ãã
nginxã¸ã®åæã¨è¨¼ææ¸ã®èªã¿è¾¼ã¿
Letâs Encryptã®è¨¼ææ¸ã¯åå¾å¾ã/etc/letsencryptããã£ã¬ã¯ããªã«ä¿åããã¾ãããããããã©ã³ãµã¼ã¨ãã¦åä½ãã¦ãããµã¼ãã«å®æçã«åæãèµ°ããã¦ãã¾ãã
nginxã§ã®è¨¼ææ¸èªã¿è¾¼ã¿ã¯ngx_mrubyãnginxã«ã¢ã¸ã¥ã¼ã«ã¨ãã¦çµã¿è¾¼ããã¨ã§åçã«è¡ãªã£ã¦ãã¾ããããã«ããåæããã証ææ¸ãã¢ã¯ã»ã¹ã®ãã³ã«åçã«èªã¿è¾¼ã¾ããnginxãåæ¢ãããã¨ãªããã¾ãnginxã®ã¡ã¢ãªãå§è¿«ãããã¨ãªãç¬èªãã¡ã¤ã³ã§ã®HTTPSã¢ã¯ã»ã¹ãã§ããããã«ãªãã¾ããã
ã¾ã¨ã
HTTPSã¯SEOã§ã®å¹æãããã¨ãããã¨ãªã®ã§ãä»åå®è£ ããæ©è½ã¯ã·ã§ããéå¶ã®å¤§ããªå©ãã«ãªãã¨æãã¾ãã ç¬èªãã¡ã¤ã³ã使ã£ã¦ããæ¹ã¯ãã²å©ç¨ãã¦ã¿ã¦ãã ããï¼
BASEã§ã¯ä¸ç·ã«ãããã·ã§ãããéçºã»æ¹åããã¨ã³ã¸ãã¢ãåéãã¦ã¾ãããèå³ã®ããæ¹ã¯ãã²éã³ã«ãã¦ãã ããã