Thanks!

You are now subscribed to our monthly blog digest. Happy reading!

Click anywhere to dismiss ...

Behind the Scenes at Jungle Disk - Say "No" to 404s

Over the last few months, we at Jungle Disk have been experimenting a lot with our website.

So far, we have a new logo, iterating on a new web site design and modifying our approach with the product pages to complement our search engine marketing (SEM) initiatives e.g. “showing” more than “telling” and a VPN-specific page to complement our Network Threat Protection page.

The inspiration for this experimentation mostly came from Google AdWords metrics, Google’s Search Console and our NGINX logs.

In the midst of this experiment, we learned that you should consider the following - say “No” to 404s. Seriously, as www.jungledisk.com is not a REST-ful web service and users seemed to be legitimately navigating to links that did not exist - why show an ugly “404/Not Found” error? Why not simply redirect the user in this case to our homepage. When enough interest is shown to a url, write a redirect or actual Web page for this “error” (the VPN landing page for example).

We opted for the “why not” approach; here’s how we did it:

The NGINX config changes were pretty simple and straightforward. To remove the concept of a “404/Not Found” response, add the following to your nginx.conf file in the server section:

...

server {
	listen 443 default_server ssl;
	listen 80;

	ssl_certificate /etc/nginx/conf.d/full.pem;
	ssl_certificate_key /etc/nginx/conf.d/full.pem;

	root   /usr/share/nginx/html;
	index  index.html;
	server_name _;

	error_page 404 =200 /index.html;

	location / {
		try_files $uri $uri.html $uri/ =404;
	}

	...
}

...

The key piece here is the error_page 404 =200 /index.html; line … this basically changes NGINX’s behavior to show index.html and return a 200 response code in the event that the requested URL cannot be found.

Another helpful bit of nginx.conf-foo is the redirects. Consider the following:

...

server {
	...

	rewrite ^/(reseller_.*) /reseller-program/ permanent;

	...
}

...

Similarly placed in a server block, this is a rewrite call that helps users who want to view information on Jungle Disk’s Reseller Program access the page with different URLs. In our logs, we noted multiple requests for paths e.g. /reseller_info, /reseller_contact, /reseller_pricing, … etc. Having this type of redirect feels like the right thing to do for now, during this experimentation period.

Reckless? Perhaps … but as we’re experimenting, we’ve found that these kind of changes and rules are better for our user’s Web experience. Try it out on your servers where it makes sense - I’d love to hear how it works for you! ;-)

Thanks, Mike

Protect Your Business Data

We are passionate about helping our customers protect their data. We want you to use Jungle Disk to protect yours. Click on Sign Up to get started. It takes less than 5 minutes!

Sign Up