Skip to content

Omeka S

Configuration

server {
    server_name omeka.example.com;
    root /var/www/omeka;

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

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

    # Block PHP in subdirectories
    location ~ \..*/.*\.php$ {
        return 403;
    }

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

    location /admin {
        try_files $uri /index.php?$args;
    }

    location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        include fastcgi_params;
        fastcgi_param HTTP_PROXY "";
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_intercept_errors on;
        fastcgi_pass 127.0.0.1:9000;
    }

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

Note

Set cgi.fix_pathinfo = 0 in php.ini.