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

About Robert Zehnder

Web application developer specializing in ColdFusion/Railo and Open Source development.

Posted on October 28, 2014, in nginx, vagrant and tagged , . Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: