The LNMP one click installation package is also one of the environments that Lao Zuo likes to use. Yesterday, after helping a netizen set up the LNMP environment, he found that after logging in to the WP background, he clicked the menu on the left and found a direct jump error of 404. At first, he thought there was a database problem. Looking up, he saw that the original path in the address bar was missing the "wp admin" path. Wordpress redirection is missing. The solution is simple. We can modify it in the/usr/local/nginx/conf/wordpress.conf file.
location / {
index index.html index.php;
if (-f $request_filename/index.html){
rewrite (.*) $1/index.html break;
}
if (-f $request_filename/index.php){
rewrite (.*) $1/index.php;
}
if (!-f $request_filename){
rewrite (.*) /index.php;
}
}
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
The green part is to be added. After adding, restart lnmp to solve the problem of missing wp admin path
/root/lnmp restart