Yesterday I was configuring WordPress and Jetpack when I got a 502 Bad Gateway error error from Nginx.

It’s simple enough to fix but I’ve not used Nginx too much, here’s the problem and solution…

When you’re using Nginx as a reverse proxy to Apache sometimes the upstream server can send headers too big to fit in the Nginx buffer. We’re using Plesk Control Panel on our server, so I’m not sure if it’s to do with the defaults set for Nginx within that but to fix it do the following.

Open /etc/nginx/nginx.conf in your favourite editor

Add the following inside the http directive:

proxy_buffers 8 32k;
proxy_buffer_size 64k;

Save it, restart Nginx and Apache, ta da!

Your mileage may vary so play about with the number of buffers and their sizes.

I made this chocolate brownie (without the peanut butter) to give as Christmas presents to friends last year. It’s gooey and incredible, the peanut butter gives it a lovely taste and crunch!

Beat the eggs and sugar

Fold in the butter and melted chocolate

Add the flour and cocoa

Spread on a lined baking tray

Freshly baked!

Eat!

Ingredients

250g of unsalted butter
300g of good dark chocolate
135g of plain flour
60g of cocoa powder
150g of good white chocolate, chopped into small pieces
150g of good milk chocolate, chopped into small pieces
A large handful of milk chocolate drops
6 medium free range eggs
410g of caster sugar
A jar of good crunchy peanut butter (Meridian brand if you can get it)

Method

Cut up the butter and chop the dark chocolate into chunks, add them both to a heavy pan and melt slowly over a low heat. Use the bain marie method if you can be bothered. When melted, leave to cool.

Sieve the flour and cocoa into a bowl and set to one side.

Break the eggs into another bowl, add the caster sugar and beat with an electric mixer until the mix has doubled in size. If you lift the beaters from the mix and it leaves a trail for a few seconds, it’s done!

Pour the cooled chocolate over the eggs and sugar. Gently fold it in to avoid knocking all the air out of the mixture.

Hold the sieve over the eggy chocolate mixture and re-sieve the flour and cocoa into it, gently fold it into the mixture to avoid knocking more air out.

Add the chopped white and milk chocolate to the mix and stir in.

Line a 3cm high brownie tray with baking parchment and pour in the mixture, ease it in to the corners and smooth out the top.

Place dots of peanut butter on top of the mix (I did half with peanut butter and half without) then sprinkle the chocolate drops on top.

You don’t have to add peanut butter, why not try chopped nuts or chocolate orange segments?

Place the tray in the oven at 175C (I’ve got a fan oven) for 30 minutes.