NGINX Reverse Proxy - conflicting server name
-
Hello Guys,
Can anyone please lead me in the direction of resolving this minor issue I have or have caused with CWP 7?
I have one hosted test domain running wordpress that occasionally gets redirect timeouts so maybe because of this.
Everything is SSL enabled, test domain and the CWP server itself.Sep 03 16:33:50 cpanel.servername.com systemd[1]: Starting nginx - high performance web server...
Sep 03 16:33:50 cpanel.servername.com nginx[21240]: nginx: [warn] conflicting server name "cpanel.servername.com" on 6.232.137.89:80, ignored
Sep 03 16:33:50 cpanel.servername.com nginx[21240]: nginx: [warn] conflicting server name "cpanel.servername.com" on 6.232.137.89:443, ignored
Sep 03 16:33:50 cpanel.servername.com systemd[1]: Started nginx - high performance web server.I have clean build of centos 7 fully patched, latest CWP script installed. Updated curl, latest apache build and mariaDB using Sandeep's shared posts on here which all worked perfectly without any issue. Thank you Sandeep.
Apache version: Apache/2.4.46
PHP version: 7.4.9
MySQL version: 10.4.14-MariaDB
FTP version: 1.0.47
SSH Port: 22
MySql Port: 3306
Web Servers: nginx-varnish-apache
CWPpro version: 0.9.8.1006I have created a WebServers Domain Conf for my test domain for Wordpress and have also created a custom Webservers domain conf for the cpanel server itself cpanel.servername.com (servername.com)
Any help would be greatly appreciated,
Cheers. G -
can you post the exact redirect error message a screenshot will be helpful
-
Hello Sandeep,
Thank you for replying
This is on the test domain which comes up very occasionally, If I restart the Nginx Reverse Proxy service, the site is back working again and will eventually get the too many redirects hours later.
That is where I noticed the "nginx: [warn] conflicting server name" error I posted above when I click the Nginx Reverse Proxy Status button in CWP to see the log. If I restart Nginx proxy service that conflicting server name shows every time.
-
remove any https redirect for htaccess and add this :
SetEnvIf X-Forwarded-Proto "https" HTTPS=on RewriteEngine on RewriteCond %{HTTPS} !=on RewriteCond %{HTTP:X-Forwarded-Proto} !https [NC] RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
or
RewriteCond %{HTTPS} off RewriteCond %{HTTP:X-Forwarded-Proto} !https RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [NE,L,R=301]
https://www.mysterydata.com/apache-http-to-https-htaccess-redirect-on-cwp-centos-webpanel/
-
Thank you Sandeep,
So that should resolve the, port 80/443 servername conflict if I add that to the main cwp domain name cpanel.servername.com .htaccess file as well as my test domain?
[warn] conflicting server name "cpanel.servername.com" on 6.232.137.89:80, ignored
[warn] conflicting server name "cpanel.servername.com" on 6.232.137.89:443, ignored -
Sorry missed your url at bottom of post, will follow it.
-
Can confirm its working now Sandeep, thanks once again for your excellent tech guides.
Very much appreciated.Cheers G