Welcome! Log In Create A New Profile

Advanced

Re: Cannot create directory alias (with php pages)

Francis Daly
August 14, 2014 08:28AM
On Thu, Aug 14, 2014 at 02:06:38PM +0300, Nikolaos Milas wrote:
> On 13/8/2014 11:42 μμ, Nikolaos Milas wrote:

Hi there,

> I have modified configuration as follows; the /xprof location works
> (i.e. I can access non php files), but all php files cannot be
> accessed (message: 404 Not Found). Nothing is recorded in the error
> log.
>
> Why can't I access the php files in /usr/share/xhprof/xhprof_htmlas
> /xhprof/filename.php ?

The request is /xhprof/filename.php; that should be handled in this
location:

> location ~ /xhprof(.+\.php)$ {
> alias /usr/share/xhprof/xhprof_html$1;
> try_files $uri =404;

The combination of a regex location, alias, and try_files, probably does
not do what you want.

I suspect that the 404-with-no-error-log comes from this try_files line.

You could (temporarily) either remove the line, or replace it with

try_files "" =404;

in order to get through to the next stage of the configuration.

> include /etc/nginx/fastcgi_params;
> fastcgi_param PATH_INFO $fastcgi_script_name;
> fastcgi_pass unix:/tmp/php-fpm.sock;
> include /etc/nginx/fastcgi_params;
> fastcgi_param SCRIPT_FILENAME $document_root$1;

alias with variables (and possibly try_files, I don't recall) probably
leave some of these variables in a state you don't expect.

Your fastcgi server, when it receives repeated fastcgi params, will
probably only honour the first or the last one received. If you care,
test so that you know, or don't send repeat params (by editing the
fastcgi_params files, and only including it once).

So: what file-on-the-filesystem do you want your fastcgi server to
process?

What variable or variables in nginx make up exactly that name?

Put that in as SCRIPT_FILENAME.

(It may be that $document_root is all you need here.)

You can see what nginx sends by looking in the debug log; or by watching
the traffic going from nginx to the fastcgi server. Or maybe your fastcgi
server has its own logging.

f
--
Francis Daly francis@daoine.org

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

Cannot create directory alias (with php pages)

Nikolaos Milas August 13, 2014 04:44PM

Re: Cannot create directory alias (with php pages)

Pascale Camille August 13, 2014 04:52PM

Re: Cannot create directory alias (with php pages)

Nikolaos Milas August 14, 2014 07:08AM

Re: Cannot create directory alias (with php pages)

Francis Daly August 14, 2014 08:28AM

Re: Cannot create directory alias (with php pages)

Nikolaos Milas August 14, 2014 09:06AM

Re: Cannot create directory alias (with php pages)

Francis Daly August 14, 2014 01:34PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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