<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Nginx on G. T. Wang</title>
    <link>https://blog.gtwang.org/tags/nginx/</link>
    <description>Recent content in Nginx on G. T. Wang</description>
    <generator>Hugo -- 0.156.0</generator>
    <language>zh-tw</language>
    <copyright>G. T. Wang</copyright>
    <lastBuildDate>Wed, 06 Nov 2019 14:28:54 +0800</lastBuildDate>
    <atom:link href="https://blog.gtwang.org/tags/nginx/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>NGINX 使用 auth_request 自訂使用者認證機制教學</title>
      <link>https://blog.gtwang.org/linux/nginxs-auth-request-module-tutorial-examples/</link>
      <pubDate>Wed, 06 Nov 2019 14:28:54 +0800</pubDate>
      <guid>https://blog.gtwang.org/linux/nginxs-auth-request-module-tutorial-examples/</guid>
      <description>&lt;p&gt;本篇介紹如何使用 Nginx 的 &lt;code&gt;auth_request&lt;/code&gt; 模組，透過自己撰寫的指令稿檢查使用者的帳號與密碼。&lt;/p&gt;
&lt;p&gt;若想限制網頁只給登入的使用者瀏覽的話，除了使用 &lt;a href=&#34;https://blog.gtwang.org/linux/nginx-restricting-access-authenticated-user-ip-address-tutorial/&#34;&gt;Nginx 基本的帳號密碼認證（auth_basic）&lt;/a&gt;之外，也可以自己撰寫認證用的指令稿，自己設計帳號密碼的檢查方式，以下是簡單的教學與示範。&lt;/p&gt;</description>
    </item>
    <item>
      <title>Ubuntu Linux 安裝 Laravel &#43; Nginx &#43; MariaDB 開發環境教學</title>
      <link>https://blog.gtwang.org/linux/ubuntu-linux-laravel-nginx-mariadb-installation-tutorial/</link>
      <pubDate>Sun, 13 Jan 2019 16:32:56 +0800</pubDate>
      <guid>https://blog.gtwang.org/linux/ubuntu-linux-laravel-nginx-mariadb-installation-tutorial/</guid>
      <description>&lt;p&gt;本篇介紹如何在 Ubuntu Linux 18.04 的環境中，安裝 Nginx 網頁伺服器、MariaDB 資料庫，打造簡單實用的 Laravel PHP 架構開發與佈署環境。&lt;/p&gt;
&lt;p&gt;

&lt;ins class=&#34;adsbygoogle&#34;
     style=&#34;display:block&#34;
     data-ad-client=&#34;ca-pub-7794009487786811&#34;
     data-ad-slot=&#34;9921134032&#34;
     data-ad-format=&#34;auto&#34;
     data-full-width-responsive=&#34;true&#34;&gt;&lt;/ins&gt;
&lt;script&gt;
     (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;/p&gt;

&lt;h2 id=&#34;安裝-laravel-相依性工具&#34;&gt;安裝 Laravel 相依性工具&lt;/h2&gt;
&lt;p&gt;在安裝好 Ubuntu Linux 18.04 之後，首先更新一下系統的套件：&lt;/p&gt;</description>
    </item>
    <item>
      <title>CentOS Linux 編譯 NGINX &#43; Google PageSpeed &#43; Brotli 模組流程記錄</title>
      <link>https://blog.gtwang.org/linux/centos-linux-compile-nginx-google-pagespeed-brotli-module-201805/</link>
      <pubDate>Mon, 14 May 2018 12:28:01 +0800</pubDate>
      <guid>https://blog.gtwang.org/linux/centos-linux-compile-nginx-google-pagespeed-brotli-module-201805/</guid>
      <description>&lt;p&gt;這裡記錄在 CentOS Linux 7 中自行編譯 Nginx + PageSpeed + Brotli 的過程。&lt;/p&gt;
&lt;p&gt;最近我嘗試各種方式，想讓 Nginx 網頁伺服器的效能再提高一些，在&lt;a href=&#34;https://blog.gtwang.org/linux/nginx-php-fpm-configuration-optimization/&#34;&gt;校調了 Nginx 與 PHP-FPM 的基本設定&lt;/a&gt;，以及&lt;a href=&#34;https://blog.gtwang.org/linux/nginx-fastcgi-cache-for-wordpress-tutorial/&#34;&gt;啟用了 FastCGI Cache 快取&lt;/a&gt;之後，接著考慮 &lt;a href=&#34;https://developers.google.com/speed/pagespeed/module/&#34;&gt;Google 的 PageSpeed 模組&lt;/a&gt;與 &lt;a href=&#34;https://github.com/google/ngx_brotli&#34;&gt;Brotli 壓縮模組&lt;/a&gt;，而這兩個工具都不是 Nginx 內建的，所以若想使用的話，就必須自己重新編譯 Nginx。&lt;/p&gt;</description>
    </item>
    <item>
      <title>NGINX 設定 FastCGI Cache 快取教學，提高 WordPress 網站載入速度</title>
      <link>https://blog.gtwang.org/linux/nginx-fastcgi-cache-for-wordpress-tutorial/</link>
      <pubDate>Fri, 11 May 2018 13:44:23 +0800</pubDate>
      <guid>https://blog.gtwang.org/linux/nginx-fastcgi-cache-for-wordpress-tutorial/</guid>
      <description>&lt;p&gt;這裡介紹如何設定 Nginx 的 FastCGI 快取功能，加速 WordPress 網頁載入速度。&lt;/p&gt;
&lt;p&gt;WordPress 是現在很流行的網站架構，它是以 PHP 語言所開發的 CMS，在使用者每一次瀏覽網頁時，都需要執行 PHP 的程式碼，產生使用者所要求的頁面，這樣的好處是可以動態產生最新的網頁內容，而缺點就是速度會比一般靜態網頁還慢很多。&lt;/p&gt;</description>
    </item>
    <item>
      <title>Nginx 與 PHP-FPM 最佳化效能設定教學與技巧</title>
      <link>https://blog.gtwang.org/linux/nginx-php-fpm-configuration-optimization/</link>
      <pubDate>Wed, 09 May 2018 12:26:42 +0800</pubDate>
      <guid>https://blog.gtwang.org/linux/nginx-php-fpm-configuration-optimization/</guid>
      <description>&lt;p&gt;這裡介紹一些 Nginx 與 PHP-FPM 相關的設定檔調整方法與技巧，最佳化網頁伺服器的效能。&lt;/p&gt;
&lt;p&gt;最近我把網站伺服器從原本的 Ubuntu Linux 14.04 換成新的 &lt;a href=&#34;https://blog.gtwang.org/linux/linode-centos-7-nginx-mysql-mariadb-php-7-installation-notes/&#34;&gt;CentOS Linux 7（LEMP 架構）&lt;/a&gt;，PHP 版本也升級成 PHP 7，結果更換之後，網頁看似正常，但不定時會出現 MariaDB 記憶體不足的錯誤訊息：&lt;/p&gt;</description>
    </item>
    <item>
      <title>Nginx 啟用 PHP-FPM 服務狀態監控網頁教學</title>
      <link>https://blog.gtwang.org/linux/nginx-enable-php-fpm-status-page-tutorial/</link>
      <pubDate>Sun, 06 May 2018 11:54:54 +0800</pubDate>
      <guid>https://blog.gtwang.org/linux/nginx-enable-php-fpm-status-page-tutorial/</guid>
      <description>&lt;p&gt;本篇介紹如何在 Nginx 與 PHP-FPM 的網頁伺服器的架構下，啟用 PHP-FPM 服務的狀態監控網頁，讓管理者查 PHP-FPM 服務內部即時的狀況。&lt;/p&gt;
&lt;p&gt;Nginx 網頁伺服器通常都會搭配 PHP-FPM 來處理 PHP 的網頁，Nginx 內部的狀態可以透過 &lt;a href=&#34;https://blog.gtwang.org/linux/nginx-enable-stub_status-module-to-collect-metrics/&#34;&gt;Nginx 內建的 stub_status 模組&lt;/a&gt;來即時監控，而 PHP-FPM 也有類似的監控功能，以下是設定與使用教學。&lt;/p&gt;</description>
    </item>
    <item>
      <title>CentOS 7 安裝 Nginx、MySQL/MariaDB、PHP7，架設 LEMP 網頁伺服器筆記</title>
      <link>https://blog.gtwang.org/linux/linode-centos-7-nginx-mysql-mariadb-php-7-installation-notes/</link>
      <pubDate>Wed, 28 Mar 2018 20:34:14 +0800</pubDate>
      <guid>https://blog.gtwang.org/linux/linode-centos-7-nginx-mysql-mariadb-php-7-installation-notes/</guid>
      <description>&lt;p&gt;這裡紀錄我在 CentOS Linux 中安裝 Nginx、MySQL/MariaDB 與 RedHat 官方的 PHP 7，打造高效能、高穩定性 LEMP 網頁伺服器的過程。&lt;/p&gt;
&lt;p&gt;最近我使用 &lt;a href=&#34;https://www.linode.com/lp/refer/?r=5b74c1f208c14942572bb1ba1f0687285c81a6b3&#34;&gt;Linode VPS 虛擬機器&lt;/a&gt;安裝了 CentOS Linux 環境，架設一台使用 PHP 7.1 的 LEMP 網頁伺服器，以下是整個架設流程紀錄。&lt;/p&gt;</description>
    </item>
    <item>
      <title>Linode 網頁伺服器遭受攻擊紀錄，用 CloudFlare 快取解決</title>
      <link>https://blog.gtwang.org/web-hosting/linode-web-server-under-attack-20170115/</link>
      <pubDate>Mon, 16 Jan 2017 10:17:15 +0800</pubDate>
      <guid>https://blog.gtwang.org/web-hosting/linode-web-server-under-attack-20170115/</guid>
      <description>&lt;p&gt;本篇文章是我的 Smooth Jazz 網站（已關站）所使用的 Linode VPS 虛擬主機遭受到惡意攻擊的紀錄。&lt;/p&gt;
&lt;p&gt;這個禮拜日放假在家，突然收到來自於 &lt;a href=&#34;https://www.linode.com/lp/refer/?r=5b74c1f208c14942572bb1ba1f0687285c81a6b3&#34;&gt;Linode&lt;/a&gt; 的 Email 警告通知訊息，告知我的 VPS 虛擬主機網路流量有異常，檢查之後發現是有無聊人士故意從網站上重複下載大檔案，似乎想灌爆伺服器的流量或頻寬，以下是整個處理過程的記錄。&lt;/p&gt;</description>
    </item>
    <item>
      <title>Nginx 防止網站圖片盜連設定，置換成廣告圖</title>
      <link>https://blog.gtwang.org/linux/nginx-image-hotlink-protection-using-rewrite/</link>
      <pubDate>Sun, 06 Nov 2016 09:34:06 +0800</pubDate>
      <guid>https://blog.gtwang.org/linux/nginx-image-hotlink-protection-using-rewrite/</guid>
      <description>&lt;p&gt;這裡介紹如何設定 nginx 網頁伺服器，防止其他網站盜連自己網站的圖片，或將圖片自動更換為廣告圖。&lt;/p&gt;
&lt;p&gt;自己架設網站的人，都會注意自己伺服器與網站的狀況，若偶爾出現幾則文章的引用，對網站的影響不大，通常一般的站長可能看過就算了，不過如果把好幾篇文章以 html 碼全文貼過去，連圖片網址都懶得改的話，這樣該網頁在載入圖檔時，還是會使用到我們自己伺服器的流量，如果流量大的時候對於伺服器還是會有一些影響的。&lt;/p&gt;</description>
    </item>
    <item>
      <title>使用 GoAccess 分析 Nginx 網頁記錄檔，即時監控伺服器狀態</title>
      <link>https://blog.gtwang.org/linux/analysing-nginx-logs-using-goaccess/</link>
      <pubDate>Mon, 23 May 2016 10:27:53 +0800</pubDate>
      <guid>https://blog.gtwang.org/linux/analysing-nginx-logs-using-goaccess/</guid>
      <description>&lt;p&gt;這裡介紹如何使用 GoAccess 來即時分析 Nginx 的 log 記錄檔，產生各種網頁伺服器的統計資訊報表，讓管理者輕鬆掌握系統狀況。&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://goaccess.io/&#34;&gt;GoAccess&lt;/a&gt; 是一個開放原始碼的網頁伺服器記錄檔分析工具，可以產生網頁版或文字版的動態統計報表，讓系統管理者可以查看即時的系統狀態，其涵蓋的資訊非常詳細，而且產生報表的方式相當簡潔，只要一行指令就可以馬上產生報表，對於 Linux 系統與指令比較熟悉的人而言，是一個非常方便的工具。&lt;/p&gt;</description>
    </item>
    <item>
      <title>即時監控 Nginx 網頁伺服器狀態，啟用 stub_status 模組</title>
      <link>https://blog.gtwang.org/linux/nginx-enable-stub_status-module-to-collect-metrics/</link>
      <pubDate>Sun, 22 May 2016 06:52:35 +0800</pubDate>
      <guid>https://blog.gtwang.org/linux/nginx-enable-stub_status-module-to-collect-metrics/</guid>
      <description>&lt;p&gt;這裡說明如何啟用 Nginx 內建的 &lt;code&gt;stub_status&lt;/code&gt; 模組，在網頁上顯示伺服器即時的負載狀況，方便管理者即時監控。&lt;/p&gt;
&lt;p&gt;Nginx 網頁伺服器本身就有內建一個簡單的即時狀態顯示模組，只要開啟 &lt;a href=&#34;https://nginx.org/en/docs/http/ngx_http_stub_status_module.html&#34;&gt;&lt;code&gt;stub_status&lt;/code&gt;&lt;/a&gt; 這個模組，就可以看到基本的伺服器狀態統計，其提供的資訊包含了：目前連線數量統計、連線與請求數量統計，以及目前請求數量統計。&lt;/p&gt;</description>
    </item>
    <item>
      <title>WordPress 設定 HTTPS 網址，強制使用 SSL 安全加密協定教學</title>
      <link>https://blog.gtwang.org/wordpress/moving-to-https-on-wordpress/</link>
      <pubDate>Mon, 16 May 2016 20:56:49 +0800</pubDate>
      <guid>https://blog.gtwang.org/wordpress/moving-to-https-on-wordpress/</guid>
      <description>&lt;p&gt;這裡說明如何設定 WordPress 網站改用 HTTPS 安全加密的傳輸協定，不但增加網站安全性，同時也大幅提升網站的效能。&lt;/p&gt;
&lt;p&gt;最新的 HTTP/2 網頁通訊協定標準加上 HTTPS 安全加密連線，可以大幅提昇網站的安全性以及網頁載入速度，我們之前介紹過如何&lt;a href=&#34;https://blog.gtwang.org/linux/secure-nginx-with-lets-encrypt-ssl-certificate-on-ubuntu-and-debian/&#34;&gt;設定 Nginx 使用 Let’s Encrypt 憑證啟用 HTTPS&lt;/a&gt;，並且&lt;a href=&#34;https://blog.gtwang.org/linux/ubuntu-linux-install-latest-nginx-with-http2-support/&#34;&gt;開啟 Nginx 的 HTTP/2 的功能&lt;/a&gt;，但是對於既有的 WordPress 網站而言，還需要一些設定工作才能讓整個網站完全符合 HTTPS 與 HTTP/2 的最新標準。&lt;/p&gt;</description>
    </item>
    <item>
      <title>Ubuntu Linux 安裝最新版 NGINX 伺服器，支援 HTTP/2 加速網頁傳輸</title>
      <link>https://blog.gtwang.org/linux/ubuntu-linux-install-latest-nginx-with-http2-support/</link>
      <pubDate>Mon, 16 May 2016 09:19:08 +0800</pubDate>
      <guid>https://blog.gtwang.org/linux/ubuntu-linux-install-latest-nginx-with-http2-support/</guid>
      <description>&lt;p&gt;這裡介紹如何在 Ubuntu Linux 上安裝最新版 Nginx 伺服器，讓網站支援 HTTP/2 傳輸協定，加快網頁的載入速度。&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://http2.github.io/&#34;&gt;HTTP/2&lt;/a&gt; 是繼 1999 年 HTTP/1.1 之後所制定的新 HTTP 傳輸協定標準，其以 Google 的 SPDY 技術為基礎，具有相當優異的傳輸與處理效能，多工（Multiplexing）的新特性可以讓瀏覽器在同時間內對多個伺服器發送請求，並採用更高效率的壓縮技術，大幅縮短網頁傳輸與處理的時間。&lt;/p&gt;</description>
    </item>
    <item>
      <title>NGINX 使用 Let’s Encrypt 免費 SSL 憑證設定 HTTPS 安全加密網頁教學</title>
      <link>https://blog.gtwang.org/linux/secure-nginx-with-lets-encrypt-ssl-certificate-on-ubuntu-and-debian/</link>
      <pubDate>Sun, 15 May 2016 16:50:08 +0800</pubDate>
      <guid>https://blog.gtwang.org/linux/secure-nginx-with-lets-encrypt-ssl-certificate-on-ubuntu-and-debian/</guid>
      <description>&lt;p&gt;本文介紹如何在 nginx 伺服器上使用免費的 Let&amp;rsquo;s Encrypt 憑證，提供 HTTPS 的安全加密網頁。&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://letsencrypt.org/&#34;&gt;Let&amp;rsquo;s Encrypt&lt;/a&gt; 是一家新的證書頒發機構（Certificate Authority，簡稱 CA），其提供免費的 TLS/SSL 憑證再配合 &lt;a href=&#34;https://certbot.eff.org/&#34;&gt;Certbot&lt;/a&gt; 這個自動化工具，讓一般的網站可以很容易地使用 HTTPS 的安全加密網頁，設定很簡單，憑證的更新也可以自動處理。&lt;/p&gt;</description>
    </item>
    <item>
      <title>修改 WordPress 上傳檔案大小限制設定（PHP 上傳大型檔案）</title>
      <link>https://blog.gtwang.org/wordpress/how-to-increase-the-maximum-file-upload-size-in-wordpress/</link>
      <pubDate>Mon, 01 Feb 2016 16:23:20 +0800</pubDate>
      <guid>https://blog.gtwang.org/wordpress/how-to-increase-the-maximum-file-upload-size-in-wordpress/</guid>
      <description>&lt;p&gt;如果在 WordPress 架設的網站上傳大型檔案時遇到錯誤，可以參考這裡的步驟教學來解決。&lt;/p&gt;
&lt;p&gt;一般使用 WordPress 所架設的網站，在預設的設定之下是沒有辦法上傳太大型的檔案的，我們可以在「上傳新媒體檔案」的頁面看到目前網站設定的最大上傳檔案大小。&lt;/p&gt;</description>
    </item>
    <item>
      <title>NGINX 設定密碼認證與限制可存取的 IP 位址，控制頻寬與連線數</title>
      <link>https://blog.gtwang.org/linux/nginx-restricting-access-authenticated-user-ip-address-tutorial/</link>
      <pubDate>Tue, 29 Dec 2015 09:30:54 +0800</pubDate>
      <guid>https://blog.gtwang.org/linux/nginx-restricting-access-authenticated-user-ip-address-tutorial/</guid>
      <description>&lt;p&gt;這裡介紹如何設定 NGINX 網頁伺服器，加上密碼認證與限制可存取的 IP 位址，並控制頻寬與連線數。&lt;/p&gt;
&lt;p&gt;在 NGINX 伺服器中若要限制只有特定的使用者可以瀏覽網頁的話，可以使用帳號與密碼認證的方式，或是設定可存取網頁的來源 IP 位址，以下是設定的步驟教學。&lt;/p&gt;</description>
    </item>
    <item>
      <title>NGINX 設定 HTTPS 網頁加密連線，建立自行簽署的 SSL 憑證</title>
      <link>https://blog.gtwang.org/linux/nginx-create-and-install-ssl-certificate-on-ubuntu-linux/</link>
      <pubDate>Sun, 29 Nov 2015 08:21:10 +0800</pubDate>
      <guid>https://blog.gtwang.org/linux/nginx-create-and-install-ssl-certificate-on-ubuntu-linux/</guid>
      <description>&lt;p&gt;這裡介紹如何在 Linux 中建立自行簽署的 SSL 憑證，設定 NGINX 讓網頁支援 HTTPS 加密連線，使資料的傳輸更安全。&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://en.wikipedia.org/wiki/Transport_Layer_Security&#34;&gt;TLS&lt;/a&gt;（前身是 SSL）是一種加密技術，它可以把未加密的網路傳輸協定包裝起來，讓所有的資料以加密的形式在網路上傳輸。以網頁來說，HTTP 是一個沒有加密的通訊協定，這樣的資料在網路上傳送時非常容易被竊取，而加上 TLS 之後的 HTTPS 就可以讓所有的資料經過加密之後在傳送，確保資料的安全。&lt;/p&gt;</description>
    </item>
    <item>
      <title>將 WordPress 網站轉移至 LEMP 伺服器</title>
      <link>https://blog.gtwang.org/wordpress/migrate-wordpress-to-lemp-server/</link>
      <pubDate>Wed, 21 Oct 2015 10:10:09 +0800</pubDate>
      <guid>https://blog.gtwang.org/wordpress/migrate-wordpress-to-lemp-server/</guid>
      <description>&lt;p&gt;本篇是將 WordPress 網站從舊的共享主機轉移至 Linode VPS LEMP 伺服器的過程紀錄。&lt;/p&gt;
&lt;p&gt;前陣子因為舊網站空間的 MySQL 資料庫出問題，所以從 &lt;a href=&#34;https://www.linode.com/lp/refer/?r=5b74c1f208c14942572bb1ba1f0687285c81a6b3&#34;&gt;Linode&lt;/a&gt; 買了一個新的 &lt;a href=&#34;https://blog.gtwang.org/web-hosting/linode-vps-registration-tutorial/&#34;&gt;VPS 主機空間&lt;/a&gt;，安裝並&lt;a href=&#34;https://blog.gtwang.org/web-hosting/linode-vps-ubuntu-linux-setup-for-security/&#34;&gt;設定好 Ubuntu Linux&lt;/a&gt; 系統之後，架設了一個 &lt;a href=&#34;https://blog.gtwang.org/linux/ubuntu-linux-setup-lemp-server/&#34;&gt;LEMP 伺服器&lt;/a&gt;，接下來就是要將既有的 WordPress 網站搬到新的 VPS 主機空間了。&lt;/p&gt;</description>
    </item>
    <item>
      <title>樹梅派 Raspberry Pi 安裝 NGINX 與 PHP 網頁伺服器（PHP-FPM）</title>
      <link>https://blog.gtwang.org/iot/raspberry-pi-install-nginx-lightweight-web-server/</link>
      <pubDate>Fri, 09 Oct 2015 14:32:35 +0800</pubDate>
      <guid>https://blog.gtwang.org/iot/raspberry-pi-install-nginx-lightweight-web-server/</guid>
      <description>&lt;p&gt;這裡介紹如何在樹梅派（Raspberry Pi）上安裝 NGINX 與 PHP，打造輕量級的網頁伺服器。&lt;/p&gt;
&lt;p&gt;NGINX 是目前很熱門的網頁伺服器，它靠著 Non-blocking 與 epoll（Linux 2.6 以後支援）等技術，讓服務連線數與處理效能大幅提升，比起傳統的 Apache 伺服器更節省系統資源，因此近年來一推出就馬上成為市場上的焦點。&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
