Welcome! Log In Create A New Profile

Advanced

Nginx config file using ipv6

Posted by pepper0505 
Nginx config file using ipv6
February 18, 2015 03:51AM
Hi, I'm vary happy to join your forum.
Few days ago I decided to install nginx on my VPS CentOS 6 + WHM. Found this: https://www.servint.net/university/article/installing-nginx-cpanel-server/ installed nginx, than when I went to WHM Plugins, there was Nginx Admin Icon, but when on click on it the nginx server was saying DOWN. I tried to start the daemon thru SSH client Putty, /etc/init.d/nginx start, but I found this error: "Starting nginx daemon: nginxnginx: [emerg] socket() [::]:80 failed (97: Address family not supported by protocol) already running." When I checked my VPS is running on IPV4, I don't now if godaddy support Ipv6 with my current VPS plan, and I don't now if I can set IPV6 ranges by myself, so I can enable IPV 6 on my server. So I looked for a walkaround and found this /etc/nginx/
./ koi-win scgi_params
../ microcache.inc scgi_params.default
fastcgi.conf mime.types uwsgi_params
fastcgi.conf.default mime.types.default uwsgi_params.default
fastcgi_params nginx.conf vhosts/
fastcgi_params.default nginx.conf.default win-utf
koi-utf proxy.inc
Found that the vhost records are comming by default with this setting:

server {
error_log /var/log/nginx/vhost-error_log warn;
listen xx.xx.xx.xxx:80;
listen [::] :80;
When I change the port to:

server {
error_log /var/log/nginx/vhost-error_log warn;
listen xx.xx.xx.xxx:80;
listen 80;
Nginx server starts working, so my question is, because I havent found at nginx.conf settings for the port, where I can change the default setting for Nginx, so when I create new accounts on WHM control panel, they will get proper settings. Now after creating I need to edit /etc/nginx/vhosts every time. And if somhow the nginx server is restarted, all sites go down, because Nginx is rewriting the directives, and the port on my vhost settings is changing again to the one I dont want to use!

Please give me advise how to set up the right settings for me!
All best
Ilian
Re: Nginx config file using ipv6
February 20, 2015 03:11AM
Thank you very much for the answers, i really appreciate your help!!!
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 221
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready