Welcome! Log In Create A New Profile

Advanced

Re: Allow directive with variables

Maxim Dounin
January 01, 2013 04:32PM
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
Subject Author Posted

Allow directive with variables

Anonymous User December 31, 2012 07:51PM

Re: Allow directive with variables

Maxim Dounin January 01, 2013 04:32PM

Re: Allow directive with variables

Mayhem30 March 19, 2015 12:31AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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