Welcome! Log In Create A New Profile

Advanced

Nginx index.php forbidden sub-directory only!

July 24, 2011 11:34AM
Hello,
'm using nginx 1.0.4 + php-fpm + wordpress. my setup works fine. but
when i try access to http://example.com/wp-admin/ it give me 403 error
and I access http://example.com/wp-admin/index.php works fine, even
http://example.com/ also works fine. Error log :
---------------------
2011/07/24 21:50:38 [error] 29939#0: *35
"/home/example/blog/public_html/wp-admin/index.php" is forbidden (13:
Permission denied), client: 125.234.x.x, server: loopback.info,
request: "GET /wp-admin/ HTTP/1.1", host: "example.com"
------------------------
And my config:
------------------------
upstream example {
server unix:/dev/shm/example.sock;

server {
listen 80;
server_name example.com;
root /home/example/blog/public_html;
index index.php;
access_log /home/example/blog/logs/access.log;
error_log /home/example/blog/logs/error.log;

location ~ /\.ht {
deny all;
}
location = /favicon.ico {
log_not_found off;
access_log off;
}

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


location / {
try_files $uri $uri/ /index.php;
}

location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass example;
include fastcgi_params;
}

location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires max;
log_not_found off;
}

}


--
Best regards,
Mr.Hien

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Nginx index.php forbidden sub-directory only!

Mr.Hien July 24, 2011 11:34AM

Re: Nginx index.php forbidden sub-directory only!

Mr.Hien July 24, 2011 02:00PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 208
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready