Welcome! Log In Create A New Profile

Advanced

Re: Nginx always searches index.php in the wrong directory

Francis Daly
May 07, 2016 05:06AM
On Fri, May 06, 2016 at 03:22:25PM -0400, Issam2204 wrote:

Hi there,

when I use your configuration and make some guesses about the content
and requests, it seems to work for me.

That is:

if the directory /var/www/html/chatserver does not exist,
then /var/www/html/index.php is processed; otherwise
/var/www/html/chatserver/index.php is processed.

> When I try to access http:// MYSERVER.net/chatserver I always have an error
> because Nginx tries to search for the index.php in the root web folder
> instead of the actual subfolder.

What output do you get from

curl -v http://MYSERVER.net/chatserver

? I expect a http 301 with a Location: of https://MYSERVER.net/chatserver

Do you get something else?

Then do another "curl -v" with whatever Location: you got.

Eventually you will get one url which shows the problem that you
report. What is that one url?

With that specific url, it should be possible to work out which location{}
you have told your nginx to use to handle it.

> rewrite ^(.*\.php)(/)(.*)$ $1?file=/$3 last;
> location / {
> location ^~ /.well-known/ {
> location ~ [^/]\.php(/|$) {

And from there, it may be more obvious where the problem that can be
solved is.

Cheers,

f
--
Francis Daly francis@daoine.org

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Nginx always searches index.php in the wrong directory

Issam2204 May 06, 2016 03:22PM

Re: Nginx always searches index.php in the wrong directory

Francis Daly May 07, 2016 05:06AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 304
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready