# Trying to working our with javascript

**URL:** <https://www.ruby-forum.com/t/trying-to-working-our-with-javascript/202795>\
**Category:** NGINX\
**Created:** [February 6, 2011, 7:22am UTC](https://www.ruby-forum.com/t/trying-to-working-our-with-javascript/202795 "2011-02-06T07:22:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [February 6, 2011, 7:22am UTC](https://www.ruby-forum.com/t/trying-to-working-our-with-javascript/202795/1 "2011-02-06T07:22:54Z")

</div>

hi i have java script document in /js/test.js

when i try to access that file i am getting error  
[www.domain.com/js/test.js](http://www.domain.com/js/test.js)

500 Internal Server Error  
nginx/0.8.53

error log showing me this

2011/02/06 15:12:44 [error] 11249#0: \*704 rewrite or internal  
redirection cycle while processing "/lightbox$  
2011/02/06 15:13:33 [error] 11245#0: \*791 rewrite or internal  
redirection cycle while processing "/lightbox$  
2011/02/06 15:16:43 [error] 11245#0: \*1165 rewrite or internal  
redirection cycle while processing "/lightbo$  
2011/02/06 15:17:58 [error] 11239#0: \*1321 rewrite or internal  
redirection cycle while processing "/lightbo$  
2011/02/06 15:19:00 [error] 11240#0: \*1402 rewrite or internal  
redirection cycle while processing "/lightbo$  
2011/02/06 15:19:23 [error] 11240#0: \*1452 rewrite or internal  
redirection cycle while processing "/lightbo$  
2011/02/06 15:19:27 [error] 11247#0: \*1473 rewrite or internal  
redirection cycle while processing "/lightbo$  
2011/02/06 15:19:54 [error] 11247#0: \*1558 rewrite or internal  
redirection cycle while processing "/lightbo$  
2011/02/06 15:20:02 [error] 11247#0: \*1585 rewrite or internal  
redirection cycle while processing "/lightbo$  
2011/02/06 15:20:15 [error] 11242#0: \*1640 rewrite or internal  
redirection cycle while processing "/lightbo$  
2011/02/06 15:20:17 [error] 11242#0: \*1652 rewrite or internal  
redirection cycle while processing "/lightbo$  
2011/02/06 15:20:22 [error] 11242#0: \*1677 rewrite or internal  
redirection cycle while processing "/lightbo$

how can i get rid of this problem i also give 755 js directory

Posted at Nginx Forum:

> **[trying to working our with javascript](https://forum.nginx.org/read.php?2,172510,172510#msg-172510)**
>
> hi i have java script document in /js/test.js when i try to access that file i am getting error www.domain.com/js/test.js 500 Internal Server Error nginx/0.8.53 error log showing me this 2011/02/06 15:12:44 \[error\]

---

<div class="post-metadata">

**Author:** ![lifeisjustabout](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/74df32/32.png) [@lifeisjustabout](https://www.ruby-forum.com/u/lifeisjustabout)\
**Post date:** [February 6, 2011, 12:14pm UTC](https://www.ruby-forum.com/t/trying-to-working-our-with-javascript/202795/2 "2011-02-06T12:14:54Z")

</div>

Hello!

On Sun, Feb 06, 2011 at 01:21:20AM -0500, lifeisjustabout wrote:

> 2011/02/06 15:12:44 [error] 11249#0: \*704 rewrite or internal  
> redirection cycle while processing "/lightbox$

[…]

> how can i get rid of this problem i also give 755 js directory

Get rid of rewrite cycle in your config, this will resolve the  
problem.

Maxim D.

---

<div class="post-metadata">

**Author:** ![lifeisjustabout](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/74df32/32.png) [@lifeisjustabout](https://www.ruby-forum.com/u/lifeisjustabout)\
**Post date:** [February 6, 2011, 12:09pm UTC](https://www.ruby-forum.com/t/trying-to-working-our-with-javascript/202795/3 "2011-02-06T12:09:08Z")

</div>

please show me your nginx.conf , thanks.

On Sun, Feb 6, 2011 at 2:21 PM, lifeisjustabout  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)wrote:

> 2011/02/06 15:19:23 [error] 11240#0: \*1452 rewrite or internal  
> redirection cycle while processing "/lightbo$
> 
> * * *
> 
> nginx mailing list  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> [mailman.nginx.org archive](http://nginx.org/mailman/listinfo/nginx)

–  
博观约取

豆瓣:www.douban.com/people/mustang/

blog: www.pagefault.info

twitter: [www.twitter.com/minibobo](http://www.twitter.com/minibobo)

---

<div class="post-metadata">

**Author:** ![lifeisjustabout](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/74df32/32.png) [@lifeisjustabout](https://www.ruby-forum.com/u/lifeisjustabout)\
**Post date:** [February 7, 2011, 4:23am UTC](https://www.ruby-forum.com/t/trying-to-working-our-with-javascript/202795/4 "2011-02-07T04:23:49Z")

</div>

Hi Maxim it works now i added this into nginx conf

rewrite /(._)(js/)(._)$ /$2$3$4 last;

thanks for your help

Posted at Nginx Forum:

> **[Re: trying to working our with javascript](https://forum.nginx.org/read.php?2,172510,172710#msg-172710)**
>
> hi i have java script document in /js/test.js when i try to access that file i am getting error www.domain.com/js/test.js 500 Internal Server Error nginx/0.8.53 error log showing me this 2011/02/06 15:12:44 \[error\]
