Nginx (on ubuntu) throwing 500 errors when going to my FW1 routes

1,186 views
Skip to first unread message

Andy Jarrett

unread,
May 23, 2016, 9:08:08 AM5/23/16
to framework-one
Hi all

I am currently stuck on a setup issue after I have installed Lucee  using Pete Freitag's script on Ubuntu with Nginx as the web server. I can browse to http://example.com/index.cfm and everything works fine, I then added my FW/1 app and tried going to a few routes and Nginx is throwing 500 messages. I've tried http://example.com/security and http://example.com/index.cfm/security and both error with the following in my log

2016/05/23 13:58:19 [error] 4395#0: *96 rewrite or internal redirection cycle while redirect to named location "@rewrites", client: 172.16.20.1, server: example.com, request: "GET /index.cfm/security HTTP/1.1", host: example.com"
2016/05/23 13:58:23 [error] 4395#0: *97 rewrite or internal redirection cycle while redirect to named location "@rewrites", client: 172.16.20.1, server: example.com, request: "GET /security HTTP/1.1", host: example.com"

This is my host setup. 

server {
 listen 80;
 server_name example.com;
 root /var/www/ufoundmytag/www/;
 set $lucee_context "example.com";

  location / {
      # First attempt to serve real files or directory, else it sends it to the @rewrite location for processing
      try_files $uri $uri/ @rewrite;
 }

  location @rewrite {
   rewrite ^(.*)? /index.cfm$uri last;
   rewrite ^ /index.cfm last;
 }


  include lucee.conf;
}


I have also asked this over at the Lucee group as I originally thought this was a cgi.path_info issue, but I now think my rewrite rules are wrong. Anyone else had/seen this error?

Cheers, Andy J




Tony Junkes

unread,
May 23, 2016, 2:04:14 PM5/23/16
to framework-one
I'm not entirely familiar with that error but as far as initial rewrites go with nginx, here's a gist of what I typically start with: https://gist.github.com/cfchef/36efc5b99acfe874f4d2

Maybe it can get you going in the right direction.

Andy Jarrett

unread,
May 23, 2016, 7:25:47 PM5/23/16
to framework-one
Cheers Tony.

Ended up implementing that and so far so good.

Andy Jarrett

unread,
May 23, 2016, 8:03:44 PM5/23/16
to framework-one
 Hey Tony

Im still playing around with this but I forked your Gist and added some bits from Pete script which you might like (or not :) )


All the best,


On Monday, May 23, 2016 at 7:04:14 PM UTC+1, Tony Junkes wrote:

Tony Junkes

unread,
May 23, 2016, 9:26:18 PM5/23/16
to framework-one
Ok cool. I'll check it out. Glad it helped!

Andy Jarrett

unread,
May 24, 2016, 4:55:11 PM5/24/16
to framew...@googlegroups.com
Thanks for that. On mobile at the moment so will check tomorrow. The Lucee forum helped me out as well. 

Due to butchering my configs while playing around I'm re setting it up tomorrow so I'll let the group know how I get on with version 2 :)


-- 
Andy Jarrett
Sent with Airmail

On 23 May 2016 at 19:04:14, Tony Junkes (tonyj...@gmail.com) wrote:

I'm not entirely familiar with that error but as far as initial rewrites go with nginx, here's a gist of what I typically start with: https://gist.github.com/cfchef/36efc5b99acfe874f4d2

Maybe it can get you going in the right direction.

--
FW/1 documentation: http://framework-one.github.io
FW/1 source code: http://github.com/framework-one/fw1
FW/1 chat / support: https://gitter.im/framework-one/fw1
FW/1 mailing list: http://groups.google.com/group/framework-one
---
You received this message because you are subscribed to a topic in the Google Groups "framework-one" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/framework-one/W9abmf96idg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to framework-on...@googlegroups.com.
Visit this group at https://groups.google.com/group/framework-one.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages