Welcome! Log In Create A New Profile

Advanced

Re: Cannot create directory alias (with php pages)

Nikolaos Milas
August 14, 2014 07:08AM
On 13/8/2014 11:42 μμ, Nikolaos Milas wrote:

> 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 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 ?

Please advise!

------------------------------------------------------------------------------------------
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(.+\.php)$ {

alias /usr/share/xhprof/xhprof_html$1;

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

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$1;
}

location ~ /xhprof(.*) {

alias /usr/share/xhprof/xhprof_html$1;

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;
deny all;

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;

}

}
------------------------------------------------------------------------------------------

Thanks,
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: 202
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