[Fix] nginx: [emerg] “load_module” 指令在 nginx.conf

模塊安裝阿帕奇 si NGINX 需要更改配置文件。 nginx.conf,在我們的例子。

對於新手用戶,改變線路和 指令在 nginx.conf 它可能是一項極限運動,特別是如果我不理解塊是如何工作的 NGINX.

錯誤 ”nginx:[emerg]“load_module”指令指定得太晚 nginx.conf”最常見的情況是在安裝 NGINX 模塊後添加它。 解決它非常簡單,我們所要做的就是將模塊行放在頂部 nginx.conf.

與其他配置文件相比,NGINX 按照傳遞給文件的順序執行指令、定義和條件。 nginx.conf.

一個具體的例子。 如果我們安裝 Brotli模塊 對於NGINX,模塊加載行必須緊跟在NGINX進程ID之後,以便以下特定行考慮這些模塊並且過程正確運行。

 user nginx;
 worker_processes 2;
 pid /var/run/nginx.pid;
 load_module modules/ngx_http_brotli_filter_module.so;
 load_module modules/ngx_http_brotli_static_module.so;
 events {
 worker_connections 1024;
 }
 ....

更改模塊加載線的位置後,執行命令 nginx -t 在 SSH 中以確保一切正常並且沒有其他錯誤。 重新啟動 NGINX 服務,使更改從 nginx.conf 有效果。

對技術充滿熱情,我很高興寫 StealthSettings.com 自 2006 年起。我在作業系統方面擁有豐富的經驗: macOS, Windows 對 Linux,而且還包括程式語言和部落格平台(WordPress)和線上商店(WooCommerce、Magento、PrestaShop)。

如何 » Linux » [Fix] nginx: [emerg] “load_module” 指令在 nginx.conf
發表評論