We have moved our Magento 2 build from an Linux Apache server to a Linux Nginx Server ... with some troubleshooting we managed to get everything working again with the exception of the Admin login.
What has been done:
cache flush, session truncated for db, inserted new admin, reset admin password, checked ngnix error logs (nothing related), made sure admin is "unlocked" via db
Still will not work with new admin or old admin. I can login via the frontend with customer accounts and they all work. its just the admin that is not working, and idea why?
Hello @patrickpla5aa2
Please follow the below steps to solve the issue.
It’s because your server does not enable rewrite mode.
sudo a2enmod rewrite
For Ubuntu / Debian edit the file /etc/apache2/apache2.conf. To edit this file, you can run command
sudo vi /etc/apache2/apache2.conf
Modify from:
<Directory /var/www/> Options Indexes FollowSymLinks AllowOverride None Require all granted </Directory>
to
<Directory /var/www/> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory>
Then restart apache
sudo service apache2 restart
or
sudo /etc/init.d/apache2 restart
If you are experencing with 403 Forbidden errors while accessing to Magento store, you should update Apache configuration to allow visitors access to your site.
sudo vi /etc/apache2/apache2.conf
Update like this:
<Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny Allow from all </Directory>
If my answer is helpful full then please set the accept solution flag and kudos flag so other members can take the same reference.
my setup is Nginx, not Apache. I will research a rewrite mode for nginx
@dipmegpro wrote:Hello @patrickpla5aa2
Please follow the below steps to solve the issue.
It’s because your server does not enable rewrite mode.
Solution
- Enable Rewrite mode
sudo a2enmod rewrite
- Configure apache
For Ubuntu / Debian edit the file /etc/apache2/apache2.conf. To edit this file, you can run command
sudo vi /etc/apache2/apache2.confModify from:
<Directory /var/www/> Options Indexes FollowSymLinks AllowOverride None Require all granted </Directory>to
<Directory /var/www/> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory>Then restart apache
sudo service apache2 restartor
sudo /etc/init.d/apache2 restartProblem 3: Page 403 Forbidden errors
If you are experencing with 403 Forbidden errors while accessing to Magento store, you should update Apache configuration to allow visitors access to your site.
Solution
- Open apache2.conf file
- For Ubuntu, the file /etc/apache2/apache2.conf. To edit this file run command
sudo vi /etc/apache2/apache2.confUpdate like this:
<Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny Allow from all </Directory>
If my answer is helpful full then please set the accept solution flag and kudos flag so other members can take the same reference.
You can use this link to setup your magento it will start work fine:
https://magecomp.com/blog/fix-404-error-page-not-found-admin-url-magento-2/
Thanks
That link is for apache i have an Nginx setup
There are a few areas I would troubleshoot to debug the Magento 2 admin login not working after migrating from Apache to Nginx:
This solution is worked for me.
Thank you