7 messages in ru.sysoev.nginxRe: perl help
FromSent OnAttachments
Kingsley ForemanFeb 4, 2009 9:26 pm 
Igor SysoevFeb 4, 2009 11:20 pm 
king...@internode.com.auFeb 5, 2009 4:45 pm 
Igor SysoevFeb 6, 2009 2:12 am 
Igor SysoevFeb 6, 2009 2:23 am 
Kingsley ForemanFeb 6, 2009 3:06 am 
Igor SysoevFeb 7, 2009 1:56 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: perl helpActions...
From:Igor Sysoev (is@rambler-co.ru)
Date:Feb 7, 2009 1:56:43 am
List:ru.sysoev.nginx

On Fri, Feb 06, 2009 at 09:36:41PM +1030, Kingsley Foreman wrote:

getting there,

I have a new error now :)

2009/02/06 21:35:23 [emerg] 10444#0: "proxy_set_header" directive is not allowed here in /etc/nginx/nginx.conf:112 2009/02/06 21:35:23 [emerg] 10444#0: the configuration file /etc/nginx/nginx.conf test failed

however it works if the if statement isn't there.

Something like this:

set $range $http_range;

if ($arg_bitstart ~ ^[1-9]\d+$) { set $range $arg_bitstart; }

proxy_pass ...;

proxy_set_header Content-Range $range; proxy_set_header Range $range;

-------------------------------------------------- From: "Igor Sysoev" <is@rambler-co.ru> Sent: Friday, February 06, 2009 8:53 PM To: <ngi@sysoev.ru> Subject: Re: perl help

On Fri, Feb 06, 2009 at 11:16:02AM +1030, king@internode.com.au wrote:

Great that mostly helped however

if ($arg_bitstart && $arg_bitstart != 0){ proxy_set_header Content-Range bytes=$arg_bitstart-; proxy_set_header Range bytes=$arg_bitstart-; }

I get this error

2009/02/06 11:12:38 [emerg] 31739#0: invalid condition "$arg_bitstart" in /etc/nginx/nginx.conf:111 2009/02/06 11:12:38 [emerg] 31739#0: the configuration file /etc/nginx/nginx.conf test failed

nginx curerently does not support "&&", etc inside "if".

However, in this case

if ($arg_bitstart) {

is enough as both "" and "0" are false. The more stronger test is:

if ($arg_bitstart ~ [1-9]\d+) {

- if ($arg_bitstart ~ [1-9]\d+) { + if ($arg_bitstart ~ ^[1-9]\d+$) {