Welcome! Log In Create A New Profile

Advanced

Re: X-Accel-Redirect doen't work with php pages

Daniele Melosi
May 28, 2009 03:10AM
Kiril Angov ha scritto:
> cat test.php?

I didn't add because it doesn't work with any php pages, test.php is a
simple php pages:
daniele@lara:/var/www$ cat test.php
<? echo "test (from PHP)"; ?>
daniele@lara:/var/www$

> On Wed, May 27, 2009 at 6:28 PM, Daniele Melosi <ml@melosi.it> wrote:
>> Hi all,
>>
>> i tried using X-Accel-Redirect as described on this guide:
>> http://blog.kovyrin.net/2006/11/01/nginx-x-accel-redirect-php-rails/
>>
>> If i use this conf:
>> daniele@lara:/var/www$ cat down.php
>> <?
>> // And redirect user to internal location
>> header("X-Accel-Redirect: /test.html");
>> ?>
>>
>> everything works fine but if i tried to call a php pages:
>> daniele@lara:/var/www$ cat down.php
>> <?
>> // And redirect user to internal location
>> header("X-Accel-Redirect: /test.php");
>> ?>
>>
>> with this error:
>> [error] 18345#0: *30 rewrite or internal redirection cycle while internal
>> redirect to "/test.php" while reading response header from upstream, client:
>> 192.168.251.27, server: localhost, request: "GET /down.php HTTP/1.1",
>> upstream: "http://127.0.0.1:880/down.php"
>>
>> this is my configuration:
>> server {
>> listen 80;
>> server_name localhost;
>>
>> location / {
>> root /var/www/nginx-default;
>> index index.html index.htm;
>> }
>>
>> location ~* .php$ {
>> proxy_pass http://127.0.0.1:880;
>> proxy_redirect off;
>>
>> proxy_set_header Host $host;
>> proxy_set_header X-Real-IP $remote_addr;
>> proxy_set_header X-Forwarded-For
>> $proxy_add_x_forwarded_for;
>>
>> client_max_body_size 10m;
>> client_body_buffer_size 128k;
>>
>> proxy_connect_timeout 90;
>> proxy_send_timeout 90;
>> proxy_read_timeout 90;
>>
>> proxy_buffer_size 4k;
>> proxy_buffers 4 32k;
>> proxy_busy_buffers_size 64k;
>> proxy_temp_file_write_size 64k;
>> }
>> }
>>
>> Daniele
>>
>>
Subject Author Posted

X-Accel-Redirect doen't work with php pages

Daniele Melosi May 27, 2009 11:28AM

Re: X-Accel-Redirect doen't work with php pages

Kiril Angov May 27, 2009 04:12PM

Re: X-Accel-Redirect doen't work with php pages

Daniele Melosi May 28, 2009 03:10AM

Re: X-Accel-Redirect doen't work with php pages

Igor Sysoev May 28, 2009 05:27AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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