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
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.