Question: I installed Icinga 1.6.0beta and tried to install it's new web interface using this [manual](http://docs.icinga.org/latest/en/icinga-web-scratch.html). But it was written for Apache. So I used the following configuration file for nginx to run the interface, but no success. I get directory listing denied in error logs. Any help?

Note: /data/developers/icinga-web symlinked to /usr/local/icinga-web

```
server {
server_name developers.example.com;
access_log /var/log/nginx/dev.access.log;
error_log /var/log/nginx/dev.error.log;
root /data/developers;

location / {
    index index.html index.htm index.php;
}

location /icinga-web/js/ext3/ {
    alias /usr/local/icinga-web/lib/ext3/;
}

location /icinga-web/ {
    if (!-e $request_filename) {
            rewrite ^(/icinga-web)(/.*)$ /icinga-web/index.php?$2 last;
    }
}

try_files $uri $uri/ /icinga-web/index.php?$args;
location ~ \.php$ {
    include /etc/nginx/fastcgi_params;

    fastcgi_split_path_info ^(/icinga-web)(/.*)$;

    fastcgi_pass  127.0.0.1:9000;
    fastcgi_index index.php;
}
}

```

Answer: 
Very few "random" number generators are actually random. Almost all are pseudorandom, following a predictable sequence when started with the same [seed value](http://en.wikipedia.org/wiki/Random_seed). Many [pseudorandom number generators](http://en.wikipedia.org/wiki/Pseudorandom_number_generator) (PRNGs) get their seed from the date and time of their initial invocation. Others get their seed from a source of random data supplied by the operating system, which often is generated from outside sources (*e.g.*, mouse motion, keyboard activity).

The right way to seed a good random number generator is to not seed it. Every good generator has a default mechanism to supply the seed, and it is usually much better than any you can come up with. The only real reason to seed the generator is if you actually **want** the same sequence of random numbers (*e.g.*, when you're trying to repeat a process that requires randomness).

See <http://msdn.microsoft.com/en-us/library/system.random.aspx> for the details of the C# Random class, but basically, it uses a very well known and respected algorithm and seeds it with the date and time.

To answer your key question, just use `rand.Next(min, max+1)` and you'll **always** get a random sequence of numbers between `min` and `max` inclusive. The sequence will be the same every time you use the same seed. But `rand = new Random()` will use the current time, and as long as your program is invoked with some separation in time, they'll be different.
"Seed" the random number generator by getting the number of seconds since midnight and then passing it in:

```
Random rand = new Random(secs);

```

This still does not generate perfectly random numbers, but should serve your purpose.