All posts tagged “nginx

Logging nginx cookies with dashes

Strangely nginx does not support variable names with dashes or other characters other than lower/uppercase letters, digits or underscores. This means that if you are trying to log cookie values which contain dashes, as in my case, you can’t do it.

Two workarounds are logging the all the cookies in one go, which can be overwhelming:

The other option is to map your cookie names to a variable that can be used by nginx:

Serve a static file on a specific URL in nginx

I recently had to serve a static file on a specific url in nginx. The requirement was that /sapm/jcb should show a specific page, but I of course forgot about the html extension so the end result was my file only appeared on /sapm/jcb.html.

An nginx conf change sorted it all out.

nginx SSL PEM_read_bio:bad end line

Installing the intermediate certificates on our server gave me the following error while trying to start up nginx again:

The end of the file looked fine, but the problem was half way through it. Somehow the concatenation had joined two lines together:

This just needed a line break to fix:

Ubuntu: Curl development headers with SSL support

Just been trying to install Passenger on a new Ubuntu EC2 instance and passenger is giving me the error:

Took some digging around but turns out I was just missing the libcurl4-openssl-dev package: