403 Forbidden Mediawiki


#1

This is my config file however when going to http://ssslippy.com/wiki/
it gives me a 403 error. I cant figure out for the life of me why.
Anyone got an idea?

In the error logs I see

2009/04/10 16:27:44 6421#0: *1 “^(GET|HEAD)$” matches “GET”, client:
1.1.1.1, server: ssslippy.com, request: “GET /wiki/ HTTP/1.1”, host:
ssslippy.com
2009/04/10 16:27:44 6421#0: *1 directory index of
“/usr/local/www/ssslippy/w” is forbidden, client: 1.1.1.1, server:
ssslippy.com, request: “GET /wiki/ HTTP/1.1”, host: “ssslippy.com

Deny access to any host other than (www.)ssslippy.com

server {
server_name _; #default
return 444;
}

Redirect www to non-www

server {
listen 204.124.180.106:80;
server_name www.ssslippy.com;
rewrite ^(.*)$ $scheme://ssslippy.com$1 permanent;
}

Server (www.)ssslippy.com

server {
listen 204.124.180.106:80;
server_name ssslippy.com;
root /usr/local/www/ssslippy;
#access_log /var/log/ssslippy.com.access.log main;
error_log /var/log/ssslippy.com.error.log debug;
#error_page 404 = /error/404.html;
#error_page 502 503 504 = /error/50x_error.html;
location /error/50x_error.html {
internal;
}

directory and index file

location / {
root /usr/local/www/ssslippy;
autoindex off;
index index.php index.html index.htm;
}

php-fpm config

location ~ .php$ {
fastcgi_index index.php;
fastcgi_pass 127.0.0.1:9000;
include fastcgi_params;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME
/usr/local/www/ssslippy$fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_intercept_errors on;
}

Wiki Config

location /wiki/ {
alias /usr/local/www/ssslippy/w;
error_page 404 = @wiki;
log_not_found off;
}

Wiki php-fpm config

location ~ ^@wiki.+.php$ {
fastcgi_index index.php;
fastcgi_pass 127.0.0.1:9000;
include fastcgi_params;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME
/usr/local/www/ssslippy/w$fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_intercept_errors on;
}

Cache of images

location ~* .(jpg|jpeg|gif|css|png|js|ico)$ {
root /usr/local/www/ssslippy;
access_log off;
expires 30d;
break;
}

Serve an empty 1x1 gif OR an error 204 (No Content) for

favicon.ico
location = /favicon.ico {
#empty_gif;
return 204;
}

If the file exists as a static file serve it directly without

running all the other rewite tests on it
if (-f $request_filename) {
break;
}

Only allow GET and HEAD request methods

  if ($request_method !~ ^(GET|HEAD)$ ) {
return 444;
  }

}

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,975,975#msg-975