Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Fri Jul 24, 2015 2:34 pm 
Offline
Senior Member

Joined: Fri Feb 11, 2011 1:36 pm
Posts: 118
Hi all,
i´m trying to setup Nginx but getting a 403 Forbidden.
I think the problem might be in the file "/etc/nginx/sites-available/default"
Code:
server {
   listen 80;

    root /srv/www;
    index index.php index.html index.htm;

    server_name mydomain.com www.mydomain.com;

    location / {
        try_files $uri $uri/ /index.php?q=$uri&$args;
    }

    location ~ \.php$ {
        try_files $uri =404;
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;
    }

    location = /favicon.ico {
        log_not_found off;
        access_log off;
    }

    location = /robots.txt {
        allow all;
        log_not_found off;
        access_log off;
    }

    location ~ /\. {
        deny all;
    }

    location ~* /(?:uploads|files)/.*\.php$ {
        deny all;
    }
}

or here in the error.log:
Code:
2015/07/24 15:41:10 [error] 21834#0: *775 directory index of "/srv/www/" is forbidden, client: 108.162.210.206, server: mydomain.com, request: "GET / HTTP/1.1", host: "www.mydomain.com"


Not sure...


Top
   
PostPosted: Fri Jul 24, 2015 9:12 pm 
Offline
Senior Member

Joined: Sun Aug 31, 2008 4:29 pm
Posts: 177
grevan wrote:
Code:
2015/07/24 15:41:10 [error] 21834#0: *775 directory index of "/srv/www/" is forbidden, client: 108.162.210.206, server: mydomain.com, request: "GET / HTTP/1.1", host: "www.mydomain.com"


That's just saying that a directory listing is forbidden. Put an index.php, index.html, or index.htm file in there and see what happens.

If you want a directory listing to be displayed, used nginx's "autoindex".

_________________
sleddog


Top
   
PostPosted: Mon Jul 27, 2015 9:51 am 
Offline
Senior Member

Joined: Fri Feb 11, 2011 1:36 pm
Posts: 118
index.php, index.html, or index.htm are already in there.
I think it might be something about url paths...


Top
   
PostPosted: Tue Jul 28, 2015 12:03 pm 
Offline
Senior Newbie

Joined: Fri Mar 08, 2013 5:47 am
Posts: 15
Check the ownership/permissions on the files themselves.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group