Re: remove if from code

2017-04-26 Thread tommygunner
Thanks! I got it to work but had to put my fastcgi stuff inside. location ~ \.php$ { try_files $uri /index.php; # fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; expires off; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php;

Re: remove if from code

2017-04-26 Thread Reinis Rozitis
Does anyone know how to rewrite this snippet? ## Execute PHP Scripts using FastCGI location ~ \.php(/.*)? { if (!-e $request_filename) { rewrite / /index.php last; } You can use try_files for that ( http://nginx.org/en/docs/http/ngx_http_core_module.html#try_files ) location

remove if from code

2017-04-25 Thread tommygunner
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(/.*)? {