Welcome! Log In Create A New Profile

Advanced

Re: Insert Variable Values when loading a Cloud Config?

Francis Daly
July 11, 2016 02:32PM
On Mon, Jul 11, 2016 at 09:40:45AM -0400, leeand00 wrote:

Hi there,

> The question involves trying to have nginx fill in the variables for the
> $private_ipv4 and $public_ipv4 when a config is loaded up. Does this
> require that I use php-fpm to somehow recognize the machine sending the
> request, and then fill in the variables when the cloud-config is requested?

I think that the nginx side of the question is:

A file exists on the filesystem. A request is made for the matching
url. Can nginx return the file contents, making some textual substitutions
in the file contents?

If that is the question, then the answers probably involves: does nginx
know what the desired substitutions are? (As in, where do the suitable
values for $private_ipv4 and $public_ipv4 come from?)

If nginx can know, then probably the sub_filter module
(http://nginx.org/r/sub_filter) can help.

You made need to check that you can include a literal $ in the string
to replace, but that should be a straightforward enough test after you
know that nginx can know what the replacement strings are.

If sub_filter is not suitable, then you could use any other active content
system (such as php-fpm) to do the work. The details will matter.

Good luck with it,

f
--
Francis Daly francis@daoine.org

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

Insert Variable Values when loading a Cloud Config?

leeand00 July 11, 2016 09:40AM

Re: Insert Variable Values when loading a Cloud Config?

Francis Daly July 11, 2016 02:32PM

Re: Insert Variable Values when loading a Cloud Config?

leeand00 July 11, 2016 09:24PM

Re: Insert Variable Values when loading a Cloud Config?

Francis Daly July 12, 2016 04:16PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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