Tweets from Last Week: 2012-03-19 to 2012-03-25

Posted in Tweets by on March 26, 2012 No Comments yet

Tweets from Last Week: 2012-03-12 to 2012-03-18

Posted in Tweets by on March 19, 2012 No Comments yet

nginx Rewrite for AtomPub on WordPress with Clean URLs

Posted in Operations by on March 13, 2012 No Comments yet

For my other blogs, Axis & Allies.org and Beer 47, I’ve shortened my workflow by pushing the photos directly from Adobe Lightroom to WordPress using the plugin LR/Blog. However, since I’m using nginx as my webserver, the AtomPub url was not working out of the box but I figured it out and I have the solution in this post.

For it’s WordPress integration, LR/Blog can use either XML-RPC or AtomPub to publish photos. Each have their benefits and drawbacks: XML-RPC doesn’t transfer the metadata for the photo, such as the title and caption, and AtomPub does not allow the photos to be updated. Since I only publish my photos one, I would much rather use AtomPub to include the titles and captions.

The default URL for the WordPress AtomPub integration is /wp-app.php/service but since I did not have a rewrite rule in nginx, I simply received a 404 error, file not found. After some experimentation I added this rewrite rule.

if ($request_uri ~* "^/wp-app.php.*$" ) {
rewrite ^/wp-app.php/(.+)$ /wp-app.php?q=$1 last;
    break;
}

If you are using clean urls, you will likely have a rewrite block something like this:

if (!-e $request_filename) {
    rewrite ^(.+)$ /index.php?q=$1 last;
    break;
}

Be sure to put your new rewrite rule before your clean url rewrite rule.

Tweets from Last Week: 2012-03-05 to 2012-03-11

Posted in Tweets by on March 12, 2012 No Comments yet

Tweets from Last Week: 2012-02-27 to 2012-03-04

Posted in Tweets by on March 5, 2012 No Comments yet