Welcome! Log In Create A New Profile

Advanced

Re: Shared nginx configuration for multiple servers

May 02, 2011 03:04PM
I'm facing a related issue, although my attempt at implementation is different from the OP.

ip.conf:
set $server_ip 10.11.1.50;

nginx.conf:
...
server {
include ip.conf; #adds the $server_ip variable which is machine-specific
listen $server_ip:80 default_server;
...
}

This fails with: nginx: [emerg] host not found in "$server_ip:80" of the "listen" directive in /opt/nginx/conf/nginx.conf:48

What is the best way to include a hard-coded IP address from another file in order to allow nginx.conf to be universal across deployed machines?

Cheers,

Dean
Subject Author Posted

Shared nginx configuration for multiple servers

Ondrej Jombik April 05, 2011 07:02PM

Re: Shared nginx configuration for multiple servers

Antoine Bonavita April 06, 2011 11:58AM

Re: Shared nginx configuration for multiple servers

Ondrej Jombik April 06, 2011 12:52PM

Re: Shared nginx configuration for multiple servers

mike April 06, 2011 12:56PM

Re: Shared nginx configuration for multiple servers

Ondrej Jombik April 06, 2011 01:12PM

Re: Shared nginx configuration for multiple servers

Antoine Bonavita April 06, 2011 02:48PM

Re: Shared nginx configuration for multiple servers

dbanks May 02, 2011 03:04PM

Re: Shared nginx configuration for multiple servers

Maxim Dounin May 02, 2011 03:28PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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