Welcome! Log In Create A New Profile

Advanced

duplicated directive on reverse proxy

June 12, 2012 09:57AM
Hi, everyone,

I'm going through some trouble with a nginx reverse proxy, and I'm kinda newbie to this tool.

Fact is, I used to have 2 reverse proxies for addressing requests from Internet on port 80 to their respective servers on intranet, and one of them crashed irreversibly, so I'm setting up a new one with similar settings to the other one.

My configuration consists on all subdomain configuration files contained on /etc/nginx/sites-available and symbolically linked to sites-enabled, and included on ngxin.conf. Subdomain files are like this:

error_log /var/log/nginx/www.DOMAIN.gov.br-error.log;
server {
listen 80;
server_name www.DOMAIN.gov.br;
access_log /var/log/nginx/www.DOMAIN.gov.br-access.log;
# Main location
location / {
proxy_pass http://192.168.9.45/;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}

My nginx.conf:

user www-data;
worker_processes 10;

error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;

events {
worker_connections 20000;
use epoll;
}

worker_rlimit_nofile 25000;

http {
include /etc/nginx/mime.types;
default_type application/octet-stream;

access_log /var/log/nginx/access.log;

sendfile on;
tcp_nopush on;

#keepalive_timeout 0;
keepalive_timeout 65;
tcp_nodelay on;

gzip on;

include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}

But when I'm trying to set up such configs to the new server, when starting up the service, it goes:

root@proxy01:/etc/init.d# /etc/init.d/nginx start
Starting nginx: [emerg]: "error_log" directive is duplicate in /etc/nginx/sites-enabled/www.DOMAIN.gov.br:1
configuration file /etc/nginx/nginx.conf test failed

It only starts when just 1 domain is configured. If another one is set, this error comes up. The other configured domain starts with "s", so nginx reads it and goes to the next letter, then we get this.

Appreciate any help!

Cheers,

Silvio
Subject Author Posted

duplicated directive on reverse proxy

oreaseca June 12, 2012 09:57AM

Re: duplicated directive on reverse proxy

Francis Daly June 12, 2012 01:14PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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