By Miki9
I have hosted two wordpress websites on single droplet and trying to host another one which is xyz.com but the problem is that when I open xyz.com it redirects to my default server domain name abc.com please help me in this, I am stuck from 2 days. DNS setting: A record @ 198.xxx.xxx.xxx CNAME:www xyz.com. CNAME:* xyz.com. ns:ns1.digitalocean.com. ns:ns2.digitalocean.com. ns:ns2.digitalocean.com.
Server Block:
server { listen 80; listen [::]:80;
root /var/www/xyz.com/html;
index index.php index.html index.htm;
# Make site accessible from http://localhost/
server_name xyz.com www.xyz.com;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ /index.php?$args;
# Uncomment to enable naxsi on this location
# include /etc/nginx/naxsi.rules
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}
thanks
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi…We are also facing similar issue…Hosted two sites, the second one is always getting redirected to the first one…The details follows:
A record for both domains: @ IP Number
CNAME for both domains: *domain name.
Server block for first domain: server { listen 80 default_server; listen [::]:80 default_server ipv6only=on;
root /var/www/first-site.in/html; index index.php index.html index.htm;
server_name first-site.in www.first-site.in;
Server block for second domain: server { listen 80; listen [::]:80;
root /var/www/second-site.net/html; index index.php index.html index.htm;
server_name second-site.net www.second-site.net;
Please tell us, how this issue can be solved…Thanks and Regards…
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.