Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I was just following the tutorial here. It says there:

This will create the virtual host file for Nginx in the sites-available directory. Simply paste the following into the file and change each instance of “” to your site’s domain name:

server {
     listen   80;
     rewrite ^/(.*)$1 permanent;

server {
     listen   80;

     access_log /var/www/;
     error_log /var/www/;

     location / {
          root   /var/www/;
          index  index.html;

The problem is that I don't have a domain name, I have an ip address... so what should I change to? I tried changing it to my ip address, but it doesn't work

share|improve this question

Add the ip address to the listen directive before the port. You might have to define your virtual hosts as the default server. See: How Nginx processes a request

Remove the first section of your server file and replace the first two lines of the second section with this using your ip address.

server {
servername _;
share|improve this answer
and how would I go in accessing this "site"? – EquinoX Feb 28 '11 at 3:59
With the ip address – Chris_O Feb 28 '11 at 4:07
what if I want to make it ip address/example – EquinoX Feb 28 '11 at 4:26

Your Answer


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.