Quantcast
Channel: Nginx Forum
Viewing all articles
Browse latest Browse all 53287

Re: Allow directive with variables

$
0
0
Hello!

On Mon, Dec 31, 2012 at 07:51:21PM -0500, justin wrote:

> I am trying to use a variable with the `allow` directive, i.e.
>
> set $home_ip 1.2.3.4;
>
> location ^~ /apc/ {
> # Allow home
> allow $home_ip;
>
> deny all;
>
> include /etc/nginx/php.conf;
> }
>
> But I am getting an error. Does the `allow` directive allow variables?

No, variables are not allowed within the "allow" directive
parameters. If a parameter can contain variables, it's indicated
in a directive description.

Note well: it's bad idea to use variables to shorten configs, see
http://nginx.org/en/docs/faq/variables_in_config.html.

--
Maxim Dounin
http://nginx.com/support.html

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

Viewing all articles
Browse latest Browse all 53287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>