I have hosted 2 website domain1.com and domain2.com in a Single Virtual machine in one of the Dedicated server, Domain1.com was provided from godaddy, Domain2.com was in namecheap.com. we have more than 15 subdomains for domain1 in godaddy. same as for domain2 we have more than 15 sub-domains in namecheap. I have checked whether there is any IP conflict by the way there was no conflict. I'am using nginx as my web server. my domain1.com working fine now, while accessing domain1.com it will be redirected to www.domain1.com. But when ever i used to access domain2.com it's showing error as follows. Please have a note on this image.
Both domain have Separate wild card SSL certificate and i have assigned it in different place too. But when accessing the domain2.com pulling the SSL cert of domain1. Below i have pasted my virtual-host entry too.
Here is my virtual host entry of domain1 and domain2.
cat 000domain1.com
server {
server_name domain1.com www.domain1.com ;
listen *:80;
return 301 https://www.domain1.com $request_uri;
}
server {
server_name domain1.com www.domain1.com ;
listen *:443 ssl;
root /var/www/domain1.com ;
index index.php index.html index.htm;
access_log /var/log/nginx/domain1.com .access.log;
error_log /var/log/nginx/domain1.com .error.log;
ssl on;
ssl_certificate /etc/nginx/ssl/STAR_domain1.com _com.pem;
ssl_certificate_key /etc/nginx/ssl/domain1.com .key;
ssl_session_timeout 5m;
ssl_protocols SSLv3 TLSv1;
ssl_ciphers ALL:!aNULL:!ADH:!eNULL:!LOW:!EXP:RC4+RSA:+HIGH:+MEDIUM;
location / {
# try_files $uri $uri/ =404;
try_files $uri $uri/ /index.php?q=$uri&$args;
}
location /cms {
index index.php index.html index.htm;
try_files $uri $uri/ /cms/index.php;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location ~ \.php$ {
# root /var/www/domain1.com ;
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}
Domain2 virtual host block:
cat 001domain2.com
server {
server_name domain2.com www.domain2.com;
listen *:80;
return 301 http://ift.tt/1uewdPR;
}
server {
server_name domain2.com www.domain2.com;
listen *:443 ssl;
root /var/www/domain2.com;
index index.php index.html index.htm;
access_log /var/log/nginx/domain2.com.access.log;
error_log /var/log/nginx/domain2.com.error.log;
ssl on;
ssl_certificate /etc/ssl/STAR_domain2.com-bundle.crt;
ssl_certificate_key /etc/ssl/domain2.com.key;
ssl_session_timeout 5m;
ssl_protocols SSLv3 TLSv1;
ssl_ciphers ALL:!aNULL:!ADH:!eNULL:!LOW:!EXP:RC4+RSA:+HIGH:+MEDIUM;
location / {
# try_files $uri $uri/ =404;
try_files $uri $uri/ /index.php?q=$uri&$args;
}
location /cms {
index index.php index.html index.htm;
try_files $uri $uri/ /cms/index.php;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location ~ \.php$ {
root /var/www/domain2.com;
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}
Both the domains are soft linked from /etc/nginx/sites-available/ to /etc/nginx/sites-enabled/ as 000domain1.com and 001domain2.com
Any guide how can i fix it ? Appreciated.
Aucun commentaire:
Enregistrer un commentaire