# 403 Forbidden Mediawiki

**URL:** <https://www.ruby-forum.com/t/403-forbidden-mediawiki/165257>\
**Category:** NGINX\
**Created:** [April 10, 2009, 10:42pm UTC](https://www.ruby-forum.com/t/403-forbidden-mediawiki/165257 "2009-04-10T22:42:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SSSlippy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b2d939/32.png) [@SSSlippy](https://www.ruby-forum.com/u/SSSlippy)\
**Post date:** [April 10, 2009, 10:42pm UTC](https://www.ruby-forum.com/t/403-forbidden-mediawiki/165257/1 "2009-04-10T22:42:19Z")

</div>

This is my config file however when going to [http://ssslippy.com/wiki/](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](http://ssslippy.com), request: “GET /wiki/ HTTP/1.1”, host:  
“[ssslippy.com](http://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](http://ssslippy.com), request: “GET /wiki/ HTTP/1.1”, host: “[ssslippy.com](http://ssslippy.com)”

## Deny access to any host other than (www.)[ssslippy.com](http://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](http://www.ssslippy.com);  
rewrite ^(.\*)$ $scheme://ssslippy.com$1 permanent;  
}

## Server (www.)[ssslippy.com](http://ssslippy.com)

server {  
listen 204.124.180.106:80;  
server\_name [ssslippy.com](http://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](http://forum.nginx.org/read.php?2,975,975#msg-975)
