Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

Nginx config file using ipv6

$
0
0
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

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>