# ${uri}index.php causing error

**URL:** <https://www.ruby-forum.com/t/uri-index-php-causing-error/186497>\
**Category:** NGINX\
**Created:** [April 8, 2010, 1:09am UTC](https://www.ruby-forum.com/t/uri-index-php-causing-error/186497 "2010-04-08T01:09:15Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![leonardocg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/e274bd/32.png) [@leonardocg](https://www.ruby-forum.com/u/leonardocg)\
**Post date:** [April 8, 2010, 1:09am UTC](https://www.ruby-forum.com/t/uri-index-php-causing-error/186497/1 "2010-04-08T01:09:15Z")

</div>

Morning!

I’ve searched the wiki for this issue and I wasn’t able to solve it,  
can anyone help?

I’m assuming nginx is getting lost with the {} on ${uri}…

This line

> try\_files $uri.php ${uri}index.php =404;

Is giving me this error:

> Starting nginx: [emerg]: directive “try\_files” is not terminated by “;” in /usr/local/nginx/sites-enabled/domain.com.au:27

If I remove “${uri}index.php” then it starts fine. This is the context:

location @php {  
try\_files $uri.php ${uri}index.php =404;  
fastcgi\_pass 127.0.0.1:9000;  
fastcgi\_intercept\_errors on;  
fastcgi\_index index.php;  
include /usr/local/nginx/conf/fastcgi\_params;  
fastcgi\_param SCRIPT\_FILENAME  
/home/public\_html/domain.com.au/public/$fastcgi\_script\_name;  
}

Thanks in advance

Leonardo

---

<div class="post-metadata">

**Author:** ![leonardocg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/e274bd/32.png) [@leonardocg](https://www.ruby-forum.com/u/leonardocg)\
**Post date:** [April 8, 2010, 11:02am UTC](https://www.ruby-forum.com/t/uri-index-php-causing-error/186497/2 "2010-04-08T11:02:15Z")

</div>

Hello!

On Thu, Apr 08, 2010 at 09:08:25AM +1000, Leonardo C. wrote:

> Is giving me this error:
> 
> > Starting nginx: [emerg]: directive “try\_files” is not terminated by “;” in /usr/local/nginx/sites-enabled/domain.com.au:27

- try\_files $uri.php ${uri}index.php =404;

- try\_files $uri.php “${uri}index.php” =404;

Curly brackets aren’t allowed outside quoted strings as they  
denote configuration blocks.

Maxim D.

---

<div class="post-metadata">

**Author:** ![leonardocg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/e274bd/32.png) [@leonardocg](https://www.ruby-forum.com/u/leonardocg)\
**Post date:** [April 8, 2010, 12:56pm UTC](https://www.ruby-forum.com/t/uri-index-php-causing-error/186497/3 "2010-04-08T12:56:24Z")

</div>

G’day mate!

> Curly brackets aren’t allowed outside quoted strings as they  
> denote configuration blocks.

Ah that’s why! So can I use either one of the 2 options? Care to  
explain the - and + signs in front of try\_files? They’re not on the  
wiki too.

Cheers!

Leo

---

<div class="post-metadata">

**Author:** ![leonardocg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/e274bd/32.png) [@leonardocg](https://www.ruby-forum.com/u/leonardocg)\
**Post date:** [April 8, 2010, 1:08pm UTC](https://www.ruby-forum.com/t/uri-index-php-causing-error/186497/4 "2010-04-08T13:08:07Z")

</div>

> Ah that’s why! So can I use either one of the 2 options? Care to  
> explain the - and + signs in front of try\_files? They’re not on the  
> wiki too.

It is not configuration option but rather how you make the ‘diff’:

- remove the line

- replace the line with this

🙂

rr

---

<div class="post-metadata">

**Author:** ![leonardocg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/e274bd/32.png) [@leonardocg](https://www.ruby-forum.com/u/leonardocg)\
**Post date:** [April 8, 2010, 1:08pm UTC](https://www.ruby-forum.com/t/uri-index-php-causing-error/186497/5 "2010-04-08T13:08:42Z")

</div>

Hello!

On Thu, Apr 08, 2010 at 08:55:38PM +1000, Leonardo C. wrote:

> G’day mate!
> 
> > Curly brackets aren’t allowed outside quoted strings as they  
> > denote configuration blocks.
> 
> Ah that’s why! So can I use either one of the 2 options? Care to  
> explain the - and + signs in front of try\_files? They’re not on the  
> wiki too.

“-” and “+” are from unified diff(1) fromat. You have to remove  
first line and add second instead (with quotes added).

[…]

> > - try\_files $uri.php ${uri}index.php =404;
> > 
> > - try\_files $uri.php “${uri}index.php” =404;

Maxim D.

---

<div class="post-metadata">

**Author:** ![leonardocg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/e274bd/32.png) [@leonardocg](https://www.ruby-forum.com/u/leonardocg)\
**Post date:** [April 8, 2010, 1:37pm UTC](https://www.ruby-forum.com/t/uri-index-php-causing-error/186497/6 "2010-04-08T13:37:24Z")

</div>

😃

Cheers mate!
