Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Following this tutorial and this followup I have a fresh Nginx + PHP5-FPM setup on Debian 6 (Squeeze) running on an OpenVZ VPS.

Right now the default virtual host works (Welcome to nginx! is displayed) as well as one other virtual host, on which I was able to successfully install WordPress. However, any further virtual hosts I create simply show Cannot find server in the title of my browser window and Access to this web page is currently unavailable. in the page.

Aside from actual domain names and file paths (DNS and file paths are apparently working properly with proper users and permissions) my virtual hosts use the same config. The configs are in /etc/nginx/sites-available/ with links at /etc/nginx/sites-enabled/. All other config files are copied from the linked blog posts.

The logs have no entries from these hits, so I'm unable to find anything useful there unfortunately.

This config below is used by all of my virtual hosts, including the one that works:

server {
  listen 80;
  server_name example.com;

  access_log /var/www/example.com/logs/access.log;
  error_log /var/www/example.com/logs/error.log;

  root /var/www/example.com/html/;
  include /etc/nginx/wordpress.conf;
  location /static {
    autoindex on;
  }
}

server {
  listen 80;
  server_name www.example.com;
  rewrite ^ http://example.com$request_uri?;
}
share|improve this question
    
Make sure that all the domain names can resolve to your VPS' IP address nslookup www.example.com. –  quanta Oct 3 '11 at 2:38
    
As someone who works with domain names and DNS all day long I am ashamed to have missed the fact that I had an off by one error in my A records. And then used those same incorrect IP addresses in my hosts file for testing. –  Gavin Oct 3 '11 at 23:39
    
Feel free to post your finding as an answer here. You can accept it after 48 hours from the initial question posting. We like having closure around these parts. –  sysadmin1138 Oct 3 '11 at 23:55
add comment

3 Answers 3

Is your wordpress installed in /var/www/example.com/html/? If you should change this document root to your install's location.

share|improve this answer
add comment

Check for the 'Include' directive in the nginx.conf file.

include /etc/nginx/sites-enabled/*;

Then try restarting Nginx.

share|improve this answer
add comment
up vote 0 down vote accepted

Despite how sure I was of my DNS records, the IP addresses were wrong - at a glance they looked identical. This also explains why I couldn't find any search results for the error message.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.