Optimzing nginx for Ghost and PHP

Running Ghost on the same server as a PHP application isn’t as difficult as it once was.


  • server_tokens off;
    Ensures that your server isn’t displaying the version
  • gzip on;
    In addition to these settings:
    gzipvary on;
    proxied any;
    gzip_comp_level 9;
    gzipbuffers 16 8k;
    gzip_http_version 1.1;
    types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;

As much as I wanted, compiling ngx_pagespeed didn’t seem like the right thing to do at this time. Haven’t had much experience with gzip, but thought turning up compression to the max was the best thing to do for now.

My one PHP app is currently an invision power board site. Initially it had problems with it’s seo settings, and saw that many IPB users were expressing desire to solve the Friendly-URL problems on nginx. Eventually, I found an excellent reference on the Xenforo help documentation on this topic – and used two of the suggestions:

The first goes in the root location block:
try_files $uri $uri/ /index.php?q=$request_uri;

The second added some links to the php files block for fastcgi:
location ~ \.php$ {
try_files $uri =404;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;

Google’s Pagespeed site said that I wasn’t using browser caching, so added this:
location ~*\.(?:ico|css|js|gif|jpe?g|png)$ {
expires max;
add_header Pragma public;
add_header Cache-Control "public, must-revalidate, proxy-revalidate"; }

Ghost needed a restart to work properly, but the development IPB forum is doing quite well.

The IBP FURLs are now at the same settings as they were when on the Apache server, with no added .htaccess file.


Lake Fayetteville Looking Nice

Since the leg around the NWA Mall was completed a few months ago, I’ve come to the front-end of the lake with less stress as time goes by. The hill beside the go-cart track has taken some getting used to.

My phone doesn’t give this view of the lake the experience it should, but it was late in the day.

I’m burning a bit more calories and reducing the internal time slightly with each ride, but noticed that my phone app isn’t recognizing an increase in speed. There is a particular downhill section around the north-east bend of lake Fayetteville where my phone proclaims my average speed of +/- 13mph. It usually improves on the way back home, but ends up being close to that number at the time I stop/save. Maybe time to consider a change in device or software.

Still have a way to go, someone else has completed 64 trips around the lake this year already.