Home  >  Article  >  Backend Development  >  Rewrite rules for https processing under Nginx only for loggingphp nginx https forward proxy nginx https ios access https build ngin

Rewrite rules for https processing under Nginx only for loggingphp nginx https forward proxy nginx https ios access https build ngin

WBOY
WBOYOriginal
2016-07-29 08:49:101019browse

Source of article: Rewrite rules for https processing only for logging.php under Nginx

Add the following configuration under https server:

if ($uri !~* "/logging.php$")
{
rewrite ^/(.*)$ http://$host/$1 redirect;
}

Add the following configuration under the http server:

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

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

The final result is that users will and will only access logging.php through https. Effectively avoid the behavior of stealing account passwords through ARP spoofing, sniffing and other methods.


The above introduces the rewriting rules for https processing under Nginx only for loggingphp, including nginx and https content. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn