Welcome! Log In Create A New Profile

Advanced

Re: Problem with aliases

Francis Daly
July 01, 2021 01:58AM
On Wed, Jun 30, 2021 at 07:31:43PM -0400, yosef wrote:

Hi there,

> Im trying to use several blocks in my server using the server IP as server
> name (no domain yet), each block points to a folder containing Wordpress. I
> dont know what Im doing wrong because instead of running index.php nginx is
> download the file.

In nginx, one request is handled in one location{}. Only the
configuration in (or inherited into) that location matters.

(One http request can become more than one (sub)request within nginx.)


> location ^~ /proj1 {
> alias /var/www/proj1/public_html;
> try_files $uri $uri/ /index.php?q=$uri&$args;
> }

"^~" means "prefix match, and do not look at parallel regex matches".

So a request for /proj1/index.php will be handled in this location{}. And
this location has no fastcgi_pass or similar directive, so it will use
"serve from the filesystem".

Probably the simplest fix is to copy the "location ~ \.php$ {" block to
be inside each of the "location ^~" blocks.


Note also -- if the request is for /proj1/missing, the try_files will
use the subrequest /index.php?q=/proj1/missing& -- is that what you want,
instead of (e.g) /proj1/index.php?q=/proj1/missing& ?

Good luck with it,

f
--
Francis Daly francis@daoine.org
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Problem with aliases

yosef June 30, 2021 07:31PM

Re: Problem with aliases

Francis Daly July 01, 2021 01:58AM

Re: Problem with aliases

yosef July 01, 2021 04:37PM

Re: Problem with aliases

Francis Daly July 02, 2021 03:52AM

Re: Problem with aliases

yosef July 03, 2021 05:15PM

Re: Problem with aliases

Francis Daly July 04, 2021 09:28AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 285
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