Jump to content
  • 0

Nginx mediawiki *2 directory index



Hello I try configure mediawiki with nginx but I still getting 403 Forbidden,

The nginx error log show this:

*2 directory index of "/var/www/html/mediawiki/" is forbidden, client:, server: wiki.it.local, request: "GET / HTTP/1.1", host: "wiki.it.local"

Here is my configuration file in /etc/nginx/sites-available/mediawiki whis is linked to /etc/nginx/sites-enbled:

server {
    server_name wiki.it.local;
    root /var/www/html/mediawiki;

    client_max_body_size 5m;
    client_body_timeout 60;

    location / {
        try_files $uri $uri/ @rewrite;

    location @rewrite {
        rewrite ^/(.*)$ /index.php?title=$1&$args;

    location ^~ /maintenance/ {
        return 403;

    location ~ \.php$ {
        include fastcgi_params;
        fastcgi_pass unix:/tmp/phpfpm.sock;

    location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
        try_files $uri /index.php;
        expires max;
        log_not_found off;

    location = /_.gif {
        expires max;

    location ^~ /cache/ {
        deny all;

    location /dumps {
        root /var/www/html/mediawiki/local;
        autoindex on;

The mediwiki file has index.php inside.

Thank you for any help.

Edited by corsairetc (see edit history)
Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.