nginxÔõôÉèÖÃÔÆЧÀÍÆ÷ÓòÃû
ÔõÑùÔÚÔÆЧÀÍÆ÷ÉÏÉèÖà nginx ÓòÃû
°ì·¨ 1£º½¨ÉèÓòÃû¼Í¼
ÔÚÓòÃû×¢²áÉÌ´¦½¨Éè A ¼Í¼£¬½«ÆäÖ¸ÏòÔÆЧÀÍÆ÷µÄ¹«¹² IP µØµã¡£
°ì·¨ 2£ºÉèÖà Nginx ÐéÄâÖ÷»ú
ÔÚ Nginx ÉèÖÃÎļþ£¨Í¨³£Î»ÓÚ /etc/nginx/conf.d/domain.conf£©ÖÐÌí¼ÓÒ»¸öÐéÄâÖ÷»ú¿é£º
server { listen 80; server_name www.example.com; root /var/www/example.com; }
µÇ¼ºó¸´ÖÆ
ÆäÖУº
listen 80£ºÖ¸¶¨ÐéÄâÖ÷»úÕìÌý¶Ë¿Ú 80£¨HTTP£©¡£
server_name www.example.com£ºÖ¸¶¨ÐéÄâÖ÷»úµÄÓòÃû¡£
root /var/www/example.com£ºÖ¸¶¨ÍøÕ¾¸ùĿ¼¡£
°ì·¨ 3£ºÖØÆô Nginx
ÖØÆô Nginx ÒÔÓ¦Óøü¸Ä£º
sudo service nginx restart
µÇ¼ºó¸´ÖÆ
°ì·¨ 4£º²âÊÔÉèÖÃ
»á¼ûÓòÃû www.example.com£¬ÈôÊÇÍøÕ¾Õý³£ÏÔʾ£¬Ôò˵Ã÷ÉèÖÃÀֳɡ£
ÆäËû×¢ÖØÊÂÏ
SSL Ö¤Ê飺ÈôÊÇÄúÐèҪʹÓà HTTPS£¬ÐèҪװÖà SSL Ö¤Êé¡£
·À»ðǽ£ºÈ·±£ÔÆЧÀÍÆ÷·À»ðǽÔÊÐí 80 ¶Ë¿ÚµÄÁ÷Á¿¡£
DNS ÆÊÎö£ºÓòÃû¼Í¼¿ÉÄÜÐèҪһЩʱ¼ä²Å»ªÉúЧ£¬ÇëÄÍÐÄÆÚ´ý¡£
ÒÔÉϾÍÊÇnginxÔõôÉèÖÃÔÆЧÀÍÆ÷ÓòÃûµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡