Welcome! Log In Create A New Profile

Advanced

Header modification with X-Accel-Redirect

Brice Leroy
May 20, 2009 07:41PM
Hi,
I'm using X-Accel-Redirect and I would like to log modified header
information at the same time. But when X-Accel-Redirect clear return
his own header , so I can never get the clip variable :(

- Brice

My Django view
...
response = HttpResponse(status=200)
response['Cache-Control'] = 'no-cache'
response['Pragma'] = 'no-cache'
response['Content-Type'] = ""
response['clip'] = one_time_access.clip.id
response['method'] = 'one_time_access_view'
response['X-Accel-Redirect'] = url
return response

and my nginx configuration:

server {
listen 80;
server_name xxx.yyy.com;

log_format main
'[$time_local]\n'
'ip=$remote_addr\n'
'request="$request"\n'
'bytes=$body_bytes_sent\n'
'clipid=$sent_http_clip\n'
'method=$sent_http_method\n'
'"$sent_http_pragma"=$sent_http_pragma'
'_EOE_\n';

access_log /home/kev/logs/access.log main;
error_log /home/kev/logs/error.log;

#add_header Front-End-Https on;

location / {
proxy_pass http://127.0.0.1:8899/;
#proxy_set_header X-Forwarded-Protocol "https";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
client_max_body_size 3000m;
}

location /media/ {
alias /home/kev/clipbuilder/media/;
internal;
}

location /static/ {
alias /home/kev/clipbuilder/static/;
}

location /adminmedia/ {
alias /usr/local/src/django-trunk/django/contrib/admin/media/;
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /var/www/nginx-default;
}
}
Subject Author Posted

Header modification with X-Accel-Redirect

Brice Leroy May 20, 2009 07:41PM

Header modification with X-Accel-Redirect

Brice Leroy May 20, 2009 08:03PM

Re: Header modification with X-Accel-Redirect

Denis F. Latypoff May 21, 2009 12:59AM

Re: Header modification with X-Accel-Redirect

Brice Leroy May 26, 2009 06:26PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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