我有一種情況,我們已經在全球範圍內爲所有非活網站設置了auth_basic
。 Nginx可否在站點特定文件中覆蓋此auth_basic
並將auth_basic
用於具有新認證密碼的站點特定路徑。如何覆蓋nginx中的全局auth_basic
auth_basic
在全球層面上設置/etc/nginx/conf.d/auth.conf
站點特定的配置位於/etc/nginx/sites-enabled/sitename.conf
在nginx.conf我:
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
不能按預期工作。全局用戶憑據總是會覆蓋後者。 – shrish
你能分享你的配置文件嗎? +你的nginx版本是什麼? – ffeast
此解決方案對我來說不起作用 –