Welcome! Log In Create A New Profile

Advanced

Change Port

Posted by inwx 
Change Port
February 24, 2014 08:48AM
Hey you,

I try to switch from apache2 to NGINX.

I edited all configs of NGINX so, that the Port listens on "1337" but NGINX is alway saying:

[...]
nginx: [warn] conflicting server name "meinedomain.de" on 123.456.789.123:1337, ignored
nginx: [warn] conflicting server name "meinedomain2.de" on 123.456.789.123:1337, ignored
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] still could not bind()
nginx.


But I cant find any entry for "80" at nginx' configs.

Are you able to help me? :)
Re: Change Port
February 24, 2014 10:03AM
I want to use an other port, because under port 80 an other webserver is running

excerpt of my config:

events {
worker_connections 1024;
}

http {
server_names_hash_max_size 1024;
server_names_hash_bucket_size 512;
types_hash_bucket_size 64;
types_hash_max_size 2048;
include mime.types;
keepalive_timeout 5;
keepalive_requests 100;
log_format default '$remote_addr - $remote_user $time_local "$request" $status $body_bytes_sent';
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log debug;
error_page 404 http://meinedomain.de/nichtvorhanden.html;

server {
listen 123.456.789.123:1337;
server_name www.meinedomain.de meinedomain.de www.meinedomain2.de meinedomain2.de
allow all;

root /www/sites/meinedomain.de/htdocs;
}
}

(And many more server {} - entrys, with the same syntax for other domains but same ip respectively port)
Re: Change Port
February 25, 2014 08:29AM
Hey you out there,

the problem was, that there as a server where no "listen" has been defined, so that this one tried to bind the domain to port "80". I edited it to "listen 1337;"

Now it worx :D
Sorry, only registered users may post in this forum.

Click here to login

Online Users

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