PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, February 1, 2022

[FIXED] Laravel Nginx overriding phpMyAdmin

 February 01, 2022     laravel, nginx, php, phpmyadmin, routing     No comments   

Issue

I am having a weird issue where Laravels routing system is overriding my phpMyAdmin. When I first setup the server my nginx setup for phpMyAdmin worked perfectly, then after installing Laravel the only thing I changed in my nginx config was the root. and now instead of going to phpmyadmin it is going to "whoops something went wrong" in laravel, which is laravel saying there is no route for that page. Any idea on how to force nginx to not use laravel for that URL? here is my current config. enter image description here


Solution

Edit to bring attention to Xavier Lucas' correction:

The ~ \.php$ location is taking precedence because it is a regular expression. Add ^~ to the top-level /phpmyadmin location (making it a regex location as well) allowing it to take precedence if matched.

location ^~ /phpmyadmin {
  ...
}

location ~ \.php$ {
  ...
}    

The ~ \.php$ location block is handling requests ending in ".php" before they reach /phpmyadmin.

Try reversing the two blocks:

location /phpmyadmin {
  ...
}

location ~ \.php$ {
  ...
}


Answered By - wolfemm
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing