Search code examples
phpnginxomeka

Omeka-s and Nginx - loop install


I have a machine with latest PHP and MySQL. I need to use Nginx. I managed to serve Omeka using this recipe:

https://www.nginx.com/resources/wiki/start/topics/recipes/omeka/

When I go to my address I am presented with the ‘Install Omeka S - Create the first user’ page. When I fill it in and I submit, the response is the same page with an empty form, i.e. I’m stuck in a loop. The POST response in the browser console gives me a 404-not found error.

I feel I’m very close, can anyone shed some light on this? I feel that Omeka should not support Apache exclusively. Is this a Omeka-s issue? Am I overlooking something obvious?

Thanks.


Solution

  • OK, I found out what the issue is. The Nginx recipe I linked in my question is valid for Omeka, not Omeka-s. For Omeka-s one has to remove the /install and also edit the /admin location. This is the working configuration:

    server {
            server_name omeka.domain.tld;
            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;
            }
    
            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)(/.+)$;
                    #NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
                    include fastcgi_params;
                    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                    fastcgi_intercept_errors on;
                    fastcgi_pass unix:/tmp/phpfpm.sock;
            }
    
            location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
                    expires max;
                    log_not_found off;
            }
    }
    

    Update

    I've pushed this recipe to Nginx wiki:

    https://www.nginx.com/resources/wiki/start/topics/recipes/omeka-s/