Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"set" directive is not allowed here

I am trying to follow this example here- https://gist.github.com/morhekil/1ff0e902ed4de2adcb7a#file-nginx-conf but getting error- "set" directive is not allowed here

what am I doing wrong? Note that I am using openresty and invoking nginx as-

nginx -p `pwd`/ -c conf/nginx.conf 

The context of my nginx.conf matches exactly as https://gist.github.com/morhekil/1ff0e902ed4de2adcb7a#file-nginx-conf

If I move the set variable to server section, I no longer get that error but a new error-

nginx: [emerg] unknown "resp_body" variable
like image 663
user375868 Avatar asked Nov 11 '14 21:11

user375868


1 Answers

After months, an answer is coming :)

Github configuration file seems wrong. set directive is used in server, location and if blocks.

Syntax: set $variable value;
Default: —
Context: server, location, if

http://nginx.org/en/docs/http/ngx_http_rewrite_module.html#set

Good luck!

like image 88
efkan Avatar answered Sep 18 '22 09:09

efkan