Forum: NGINX 403 error for one of my server blocks

2974d09ac2541e892966b762aad84943?d=identicon&s=25 nginxmike (Guest)
on 2014-01-12 05:05
(Received via mailing list)
Hi,

I installed nginx on an ubuntu server and then followed this tutorial
(which
I'll quote from) to setup server blocks
https://digitalocean.com/community/articles/how-to...
.(I don't do any of the WordPress config in that article). It uses a
common.conf that the server blocks inherit from.

In one of my server blocks, I setup a basic index.html page and set my
domain name for the server name in the server block file.

In the directory for my other server block, I setup a node app. That's
the
one where I'm getting the 403 error.

Anyone know why this might be happening and how I might debug and/or fix
it?


server block

server {
    # URL: Correct way to redirect URL's
    server_name demo.com;
    rewrite ^/(.*)$ http://www.demo.com/$1 permanent;
}
server {
    server_name www.demo.com;
    root /home/demouser/sitedir;
    access_log /var/log/nginx/www.demo.com.access.log;
    error_log /var/log/nginx/www.demo.com.error.log;
    include global/common.conf;
}



common.conf

# Global configuration file.
# ESSENTIAL : Configure Nginx Listening Port
listen 80;
# ESSENTIAL : Default file to serve. If the first file isn't found,
index index.php index.html index.htm;
# ESSENTIAL : no favicon logs
location = /favicon.ico {
    log_not_found off;
    access_log off;
}
# ESSENTIAL : robots.txt
location = /robots.txt {
    allow all;
    log_not_found off;
    access_log off;
}
# ESSENTIAL : Configure 404 Pages
error_page 404 /404.html;
# ESSENTIAL : Configure 50x Pages
error_page 500 502 503 504 /50x.html;
    location = /50x.html {
        root /usr/share/nginx/www;
    }
# SECURITY : Deny all attempts to access hidden files .abcde
location ~ /\. {
    deny all;
}
# PERFORMANCE : Set expires headers for static files and turn off
logging.
location ~*
^.+\.(js|css|swf|xml|txt|ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$
{
    access_log off; log_not_found off; expires 30d;
}

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,246285,246285#msg-246285
36a8284995fa0fb82e6aa2bede32adac?d=identicon&s=25 Francis Daly (Guest)
on 2014-01-12 10:44
(Received via mailing list)
On Sat, Jan 11, 2014 at 11:04:35PM -0500, nginxmike wrote:

Hi there,

> In the directory for my other server block, I setup a node app. That's the
> one where I'm getting the 403 error.
>
> Anyone know why this might be happening and how I might debug and/or fix
> it?

What http request do you make that does not give the response that you
want?

What does the error log say about that request?

  f
--
Francis Daly        francis@daoine.org
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.