Blog Archives

TIL: Vagrant, Nginx and illegal token errors


Recently I have moved all my development to Vagrant virtual machines to avoid having to setup a dev environment on my local machine. Mark Drew has an excellent article on how to set this up. My setup is modeled very close to Mark’s setup however I setup Nginx as a reverse proxy back to Tomcat as this models my production environment.

I had everything setup but I ran into trouble pretty quickly any time I changed a javascript file it would completely wreck the file and I would get illegal token errors. It appears there is an issue with VirtualBox when serving static content through Nginx if you are using shared folders. The fix for this issue is turning sendfile off in the Nginx configuration. More information can be found here.

Hopefully this will help someone out because I know I was pulling my hair out on this one.

Advertisements

Chat demo ColdBox application pushed to GitHub


Back in June I ported a simple chat application so that it would work with the Coldbox framework. Brad Wood suggested making the entire application freely available on GitHub instead of posting the individual components as Gists. Well, I finally got around to doing that and you may find my entire demo site here:

http://github.com/robertz/Demos

As long as your server supports SES URLs you should be in business. I do use submodules with my git projects so you will have to ensure that the coldbox-platform submodule is initialized.

I also have been playing around with Vagrant so I can easily spin up a virtual machine that matches my production environment. I have a box setup with Railo using Nginx as a proxy that I am currently using for development and if anyone is interested I may make that available for download. It is great to start working on a new project and just typing “vagrant up” to spin up the dev server without having to worry about doing a server config. Vagrant is just awesome.