Welcome! Log In Create A New Profile

Advanced

Stop nginx to listen to port 80

Posted by coredev 
Stop nginx to listen to port 80
May 08, 2009 07:15AM
Hi. How do i stop nginx to stop listen top port 80? I've configured on port 777 right now, but i cant start it becose it says

[code]
2009/05/08 13:07:47 [emerg] 5535#0: bind() to 0.0.0.0:80 failed (98: Address already in use)
[/code]

here's my config
[code]
user www-data;
worker_processes 1;

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

events {
worker_connections 1024;
}

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/*;

upstream cluster {
server XXXXXXXXXXXXXXXXXX:80;
server XXXXXXXXXXXXXXXXXX:80;
}

server {
listen 777;
server_name XXXXXXXXXXXXXXXXXX;
location / {
proxy_pass http://cluster;
}
}
}

[/code]

I'm trying to use nginx as a loadbalancer..
Re: Stop nginx to listen to port 80
May 08, 2009 08:14AM
Do you have something in /etc/nginx/sites-enabled/* that's trying to grab 80?

--
Jim Ohlstein
Re: Stop nginx to listen to port 80
May 08, 2009 09:15AM
Nope.. Doesn't even have that directory..
Re: Stop nginx to listen to port 80
May 08, 2009 09:46AM
That doesn't make any sense.

Maybe try turning off your backend for a moment and confirm that 80 is free with

# lsof -an | grep 80

Then start nginx and rerun the command and see if nginx has grabbed it?

--
Jim Ohlstein
Re: Stop nginx to listen to port 80
May 08, 2009 10:45AM
Or check, if you are editing good nginx conf file :)

alfi
Re: Stop nginx to listen to port 80
May 28, 2009 04:17AM
Hi,the port 777 maybe used by other application.

I suggest you try other port,such as 8080

[img]http://blog.chinaunix.net/u3/94039/up_user.jpg[/img]


=========================================================
My blog:[url=http://hi.baidu.com/usen68]http://hi.baidu.com/usen68[/url]

I come from China .I love programming.Although don't use very good,I am glad to using PHP technology development.In web development, I found Nginx suit my application.I came here to learn more about Nginx.In the learning process, I hope everybody can give me help.Thank you!

我的个人空间是使用Baidu 公司的免费空间,里面主要是我个人的一些技术总结。其中包括Linux 发行版安装和使用说明,PHP 开发及安全配置,Linux 游戏介绍等。
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 72
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready