Welcome! Log In Create A New Profile

Advanced

Cannot create directory alias (with php pages)

Nikolaos Milas
August 13, 2014 04:44PM
Hello,

I have a hard time trying to make a "directory alias" (in Apache
terminology - sorry, I still have a lot to learn on nginx)...

I have piwik.example.com, configured to run piwik analytics (it is a php
site), and it works fine.

I runs under nginx v1.6.1, php-fpm v5.3.3 on an updated CentOS 6.5 64bit
VPS.

Now, I want to create an /xhprof location, which includes php code and
lives in another disk path (in: /usr/share/xhprof/xhprof_html). I can't
make this work...

I have tried multiple possible solutions, googled around, but it just
won't work.

Follows the attempted config. In this, calling
http://piwik.example.com/xhprof or
http://piwik.example.com/xhprof/index.php returns "404 Not Found".

The error log shows: "rewrite or internal redirection cycle while
internally redirecting to "/xhprof".

server {

listen [::]:80;

server_name piwik.example.com;
access_log /var/webs/wwwpiwik/log/access_log main;
error_log /var/webs/wwwpiwik/log/error_log warn;
root /var/webs/wwwpiwik/www/;

index index.php index.html index.htm index.cgi default.html
default.htm default.php;

location / {
try_files $uri $uri/ /index.php?$args;
allow 127.0.0.1;
allow ::1;
allow 10.10.10.0/24;
deny all;
}

location /xhprof {

alias /usr/share/xhprof/xhprof_html;

try_files $uri $uri/ /xhprof$is_args$args;

allow 127.0.0.1;
allow ::1;
allow 10.10.10.0/24;
deny all;
}

location ~ \.php$ {

allow 127.0.0.1;
allow ::1;
allow 10.10.10.0/24;

fastcgi_cache off;

try_files $uri =404;
include /etc/nginx/fastcgi_params;
fastcgi_param PATH_INFO $fastcgi_script_name;

fastcgi_intercept_errors on;

fastcgi_buffer_size 384k;
fastcgi_buffers 256 16k;
fastcgi_busy_buffers_size 384k;
fastcgi_temp_file_write_size 384k;
fastcgi_read_timeout 240;

fastcgi_pass unix:/tmp/php-fpm.sock;

fastcgi_index index.php;
include /etc/nginx/fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

}

}

I appreciate your help in correcting the /xhprof definition, in order to
make it work...

I also

Thanks in advance,
Nick


_______________________________________________
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: 267
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