首頁  >  文章  >  後端開發  >  Nginx下只針對loggingphp進行https處理的重寫規則 nginx https 正向代理 nginx https ios訪問 https搭建 ngin

Nginx下只針對loggingphp進行https處理的重寫規則 nginx https 正向代理 nginx https ios訪問 https搭建 ngin

WBOY
WBOY原創
2016-07-29 08:49:101021瀏覽

文章來源:Nginx下只針對logging.php進行https處理的重寫規則

在https server下加入以下配置:

if ($uri !~* "/logging.php$")
{
if ($uri !~* "/logging.php$")
{

{

rewrite ^/(.*)$ http://$host/$1 redirect;

}

在http server下加入以下設定:

if ($uri ~* "/logging.php$")

{

rewrite ^/(.*)$ https://$host/$1 redirect;

}

最後結果就是,使用者會且只會在存取logging.php的情況下,才會透過https存取。有效地避免了arp欺騙、嗅探等方法盜取帳號密碼的行為。

以上就介紹了Nginx下只針對loggingphp進行https處理的重寫規則,包含了nginx,https方面的內容,希望對PHP教學有興趣的朋友有所幫助。 🎜 🎜 🎜
陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn