server {
location / {
try_files $uri $uri/ @extensionless-php;
}
location /shop {
try_files $uri $uri/ /shop/index.php?q=$uri&$args /shop/index.php?q=$uri&$args;
}
location ~ \.php$ {
if ($request_uri ~ (.*)\.php$)
{
return 301 $1;
}
try_files $uri =404;
include /etc/nginx/fastcgi.conf;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
location @extensionless-php {
rewrite ^(.*)$ $1.php last;
}
The above code is used in nginx server file. I have wordpress installed in a subdirectory. When I try to login into my dashboad using username and password through wp-login.php page it redirects to 404 not found. The other pages of the wordpress blog works fine. I cannot access my dashboard only. Please help me to solve the issue. Thanks in advance.