By bgslvsky
Hi everyone,
I’m having issues putting getting two host name blocks working together. I have a lemp server which has a Wordpress MU setup. I would also like to run a seperate website/domain for a regular html site.
So I have domain1.com which is WP MU domain2.com which is a regular html site.
I followed this tutorial to setup my wordpress mu https://www.digitalocean.com/community/tutorials/how-to-set-up-wordpress-multisite-with-nginx-on-ubuntu-14-04
I have WP MU setup my working perfectly.
My domain1.com configuration looks like this:
server {
listen [::]:80 ipv6only=off;
server_name domain1.com *.domain1.com;
root /usr/share/nginx/wordpress;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ /index.php?$args ;
}
location ~ /favicon.ico {
access_log off;
log_not_found off;
}
location ~ \.php$ {
try_files $uri /index.php;
include fastcgi_params;
}
access_log /var/log/nginx/$host-access.log;
error_log /var/log/nginx/wpms-error.log;
}
My domain2.com config looks like this
server {
listen 80;
listen [::]:80;
root /var/www/domain2.com/html;
index index.html index.htm;
server_name domain2.com www.domain2.com;
location / {
try_files $uri $uri/ =404;
}
}
When I try to restart ngnix it fails. What is also strange is that when I go to my server ip or domain2.com it automatically redirects to my domain1.com/wp-signup page
Could someone shed some light on what I’m doing wrong?
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!
What does the Nginx error log say? This always hands over important and usefull information you can use to debug your vhosts.
/var/log/nginx/error.log
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.