Re: alias

On Mon, Dec 09, 2013 at 05:03:55PM +0000, Matthew Ngaha wrote:

Where does the example come from? It may be worth asking the author to
fix it.

Hi Francis It was from nginx http server

If you ask for http://localhost/request.html, nginx will try to
send the file /var/www/website.com/html/request.html. If you ask for
http://localhost/admin/request.html, nginx will try to send the file
/var/www/locked/request.html.

The problem i’ve been having after looking in the error logs,is that
it’s still trying to find /admin/ in the default html root. I’ve tried
new locations, new roots inside these new locations for /admin/, and
now ive tried alias. All have been 404 Not Found due to nginx
searching for these paths in root html; …Any ideas how i can write
this? Here’s is my default setup, how could i create an alternative
path from the root.

server {
    listen       80;
    server_name  localhost;
    root   html;
    #charset koi8-r;

    #access_log  logs/host.access.log  main;
    }

Also i don’t know how this message will turn out, i only recieve daily
digests so i had to reply to the digest and not individual the mail
itself. Is there a way to stop recieving nginx mail via digests and
just recieve each individual mail?

On Tue, Dec 10, 2013 at 10:17:25PM +0000, Matthew Ngaha wrote:

On Mon, Dec 09, 2013 at 05:03:55PM +0000, Matthew Ngaha wrote:

Hi there,

http {
server {
server_name localhost;
root /var/www/website.com/html;
location /admin/ {
alias /var/www/locked/;
}
}
}

The problem i’ve been having after looking in the error logs,is that
it’s still trying to find /admin/ in the default html root.

That suggests that the configuration you are editing, and the
configuration that nginx is using, are not the same.

You can test by adding the following line:

location = /test/ {return 200 "This is a test\n";}

just after the server_name line and reloading nginx.

If “curl -i http://localhost/test/” does not show you “This is a test”,
then that’s your problem.

After you fix that, the rest should become clear.

Also i don’t know how this message will turn out, i only recieve daily
digests so i had to reply to the digest and not individual the mail
itself. Is there a way to stop recieving nginx mail via digests and
just recieve each individual mail?

Start here:

http://mailman.nginx.org/mailman/listinfo/nginx

Cheers,

f

Francis D. [email protected]

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs