I've been using Hosting cloud-config using nginx as an example:
There's a config that you need to put into nginx config file:
location ~ ^/user_data {
root /path/to/cloud/config/files;
sub_filter $public_ipv4 '$remote_addr';
sub_filter $private_ipv4 '$http_x_forwarded_for';
# sub_filter $private_ipv4 '$http_x_real_ip';
sub_filter_once off;
sub_filter_types '*';
}
However, when I do that, nginx -t gives:
nginx: [emerg] unknown "public_ipv4" variable
nginx: configuration file /etc/nginx/nginx.conf test failed
How do I fix this?
I'm using nginx 1.10.1 compiled with http_sub_module.