Posts Tagged: Nginx


Getting Vanilla Forums to Work on Nginx

# Rewrite to prettify Vanilla forum URLs location /forum { try_files $uri $uri/ @forum; } location @forum { rewrite ^/forum(.+)$ /forum/index.php?p=$1 last; } It’s that simple. Add that to your server block in Nginx, and change “forum” to where your Vanilla Forum is installed. $ sudo service nginx reload Don’t forget to open up conf/config.php

Switching from using a Socket to TCP/IP in PHP-FPM

A couple of websites on our DigitalOcean VPS  have a great amount of traffic. Due to this traffic, I ran into the error below (edited for readability). [crit] connect() to unix:/var/run/php5-fpm.socket failed 2 No such file or directory This was because the amount of concurrent users was starting to get high. Instead of fiddling around

Google Chrome “ERR_SPDY_PROTOCOL_ERROR” Quick Fix

While using Chrome, you may have come across a ERR_SPDY_PROTOCOL_ERROR error. This has happened to me personally many times on websites such as Facebook and a couple that I develop myself. The issue is hard to reproduce and there are no error logs on the server to be had. What would happen is you’d navigate to the

Using an Nginx Rewrite to Add Trailing Slashes to Your URLs

rewrite ^([^.]*[^/])$ $1/ permanent; Add to your server block. This line will add a trailing slash o the end of your URLs, as long as they don’t contain a period (for things like static assets), and if it does not already have a trailing slash. This is a handy way to improve SEO by redirecting

PHP5-FPM and Nginx White Screen

Ah, the infamous white screen of death. After doing some server and package upgrades, I ran across the problem of a blank screen being generated when trying to access the websites located on the server. None of the configuration files were changed, I had simply upgraded some packages and kept my settings intact. After checking

XenForo in a Subdirectory (Nginx)

  For one of my recent projects, I needed to use WordPress and XenForo — with WordPress sitting at the root and XenForo in a subdirectory called community. Here’s the config file that I used to successfully install XenForo in a subdirectory. It’s really simple. ## ## # Subdirectory for XenForo # ## ## location

Upgrading Your Version of Nginx

When you’re on an LTS (Long Term Support) version of Ubuntu, such as 12.04 or 14.04, the repositories that are included may not be fully up-to-date. Using Ubuntu 12.04, the version of Nginx that comes in the source package is 1.1.19, while the latest stable version at the time of this writing is 1.6.0. You

Getting Fonts Working Cross-Origin

We use a font icon set called FontAwesome at Obstance and ran across a small problem: we were unable to get it to load cross origin. What this means is that if you’re linking your fonts from a domain other than the one you’re on, such as one from a CDN, it won’t load in

Getting Textpattern to Work With Nginx

If you’re thinking about giving these two a go with each other, this little snippet may help you out. Open up or create the file for your website that goes into the sites-available directory and add the below along with what you have so far. Make sure to change the socket to TCP if that’s