1

I am currently working on a script which uses pseudo url rewriting. Url like http://domain.com/index.php/admin work fine on Apache servers, but fail to run on the nginx webserver.

Is there a way let the software run on nginx?

1 Answer 1

1

Try this in your server {} block:

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

EDIT:

Does it not work even with index.php in the URL? What are you using to pass the PHP script to PHP? This is what I use and URLs of that kind work for me:

    location ~ \.php$ {
            try_files $uri =404;
            fastcgi_split_path_info ^(.+\.php)(/.+)$;
            # With php5-fpm:
            include fastcgi_params;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            fastcgi_pass unix:/var/run/php5-fpm.sock;
    }
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.