remove if from code

tommygunner nginx-forum at forum.nginx.org
Tue Apr 25 20:16:19 UTC 2017


I am using Nginx 1.13 and have read that using "if" is a poor solution. I
have looked through my configuration file and found one and would like to
rewrite it without the "if". Does anyone know how to rewrite this snippet?

## Execute PHP Scripts using FastCGI
	location ~ \.php(/.*)? {
    if (!-e $request_filename) {
        rewrite / /index.php last;
    }

Thanks

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,273865,273865#msg-273865



More information about the nginx mailing list