差異處

這裏顯示兩個版本的差異處。

連向這個比對檢視

兩邊的前次修訂版 前次修改
tech:nginx [2019/09/24 17:33] jonathan_tsaitech:nginx [2021/03/17 14:14] (目前版本) – [設定 Virtual Host] jonathan
行 107: 行 107:
 </file> </file>
 </note> </note>
 +
 +
 +<WRAP center round info 80%>
 +  * 因有朋友告知 http://ichiayi.com 出現 404 找不到網頁狀況, 所以針對 /etc/nginx/conf.d/www_ichiayi.conf 進行修改, 將 ichiayi.com 加入 server 內和 www.ichiayi.com 一樣<file>
 +server {
 +        server_name     ichiayi.com www.ichiayi.com;
 +:
 +:
 +    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
 +
 +}
 +
 +server {
 +    if ($host = www.ichiayi.com) {
 +        return 301 https://$host$request_uri;
 +    } # managed by Certbot
 +
 +    if ($host = ichiayi.com) {
 +        return 301 https://www.ichiayi.com$request_uri;
 +    }
 +
 +        listen  80 default_server;
 +        server_name     ichiayi.com www.ichiayi.com;
 +    return 404; # managed by Certbot
 +}
 +</file>然後重新啟動 nginx <cli>
 +systemctl restart nginx
 +</cli>
 +</WRAP>
  
 ===== 其他相關資訊 ===== ===== 其他相關資訊 =====
  • tech/nginx.1569317591.txt.gz
  • 上一次變更: 2019/09/24 17:33
  • jonathan_tsai