#Nginx

15 posts tagged Nginx

WordPress unable to connect to SQL database

· linux, software, www

Yesterday, three blogs I'm hosting suddenly went offline and alerts went off.

They all had the same error that they couldn't connect to their SQL database, and it seemed that the container recently was auto-updated.

Docker logs also showed (which may or may not have been related):

2024-02-21  7:30:29 97 [Warning] Aborted connection 97 to db: 'unconnected' user: 'unauthenticated' host: '192.168.200.4' (This connection closed normally without authentication)

This was odd. I started the usual troubleshooting:

EVA and WiFi

· networking, travel

So I am flying EVA from SIN - TPE - JFK and back. For the first time I also went to the dark side (16hrs was too long to be locked up with just my mind) and got onboard WiFi.

This seems to come with unlimited data for ~20USD for 24hrs. I manage to stream Google Music just fine.

I totally went Matrix mode during the flight. While the flight is half empty I am wondering if they think I am haxoring it now.

Theme

· hardware, linux, networking, software, virtualisation, www

I had the same theme for over four years. I’ve made quite a few custom css and PHP edits myself, and it had been outdated for ages… But it served me well.

theme-2011

However, it’s now time for something new.

theme-2015

As always, as minimalistic as possible.

On a side note, this blog has been moved from vm1 (and one before that) a virtual machine running on a dual Xeon 3070 (2.66Ghz) at Databarn to Akama, a VM on an 8 core Xeon E3-1230 (3.2Ghz) at Leaseweb.

Raspberry Pi + ad blocking + nginx

· linux, networking, software, www

There’s this howto that explains how to set up the RPi as ad blocker.

I’ve two RPi’s acting a router and was already running dnsmasq. I decided to give it a try. Note that this howto can actually be used on any DNS serving Linux server.

First of all, don’t go with the pixelserv as it crashes after a few minutes.

Apache is an option that worked fine. A general hint: if you’re already running Apache or whatever on port 80, just add a 2nd static IP and make Apache listen to that.

413 Request Entity Too Large

· misc

Since I started pushing kernel and modules through Puppet (as raw files, instead of .deb packages) I randomly got these errors:

[...]
/usr/lib/ruby/1.8/puppet/agent/locker.rb:21:in `lock'
/usr/lib/ruby/1.8/puppet/agent.rb:44:in `run'
/usr/lib/ruby/1.8/sync.rb:230:in `synchronize'
/usr/lib/ruby/1.8/puppet/agent.rb:44:in `run'
/usr/lib/ruby/1.8/puppet/agent.rb:108:in `with_client'
/usr/lib/ruby/1.8/puppet/agent.rb:42:in `run'
/usr/lib/ruby/1.8/puppet/application.rb:172:in `call'
/usr/lib/ruby/1.8/puppet/application.rb:172:in `controlled_run'
/usr/lib/ruby/1.8/puppet/agent.rb:40:in `run'
/usr/lib/ruby/1.8/puppet/application/agent.rb:337:in `onetime'
/usr/lib/ruby/1.8/puppet/application/agent.rb:311:in `run_command'
/usr/lib/ruby/1.8/puppet/application.rb:309:in `run'
/usr/lib/ruby/1.8/puppet/application.rb:416:in `hook'
/usr/lib/ruby/1.8/puppet/application.rb:309:in `run'
/usr/lib/ruby/1.8/puppet/application.rb:407:in `exit_on_fail'
/usr/lib/ruby/1.8/puppet/application.rb:309:in `run'
/usr/lib/ruby/1.8/puppet/util/command_line.rb:69:in `execute'
/usr/bin/puppet:4
err: Could not send report: Error 413 on SERVER: <html>
<head><title>413 Request Entity Too Large</title></head>
<body bgcolor="white">
<center><h1>413 Request Entity Too Large</h1></center>
<hr><center>nginx/1.1.19</center>
</body>
</html>

The error seems quite easy to solve by modifying nginx’ config to allow bigger body sizes.

nginx: could not build the server_names_hash

· errors, linux, www

I’ve recently started switching my custom nginx installations to the Debian repository version.

So from 0.9.4 to 0.6.32 (Lenny), which will be upgraded to 0.7.x in Squeeze.

I’ve come across this error on certain servers:

# /etc/init.d/nginx restart
Restarting nginx: 2011/02/11 11:34:58 [emerg] 3624#0: could not build the server_names_hash, 
you should increase server_names_hash_bucket_size: 32
nginx.

This can be solved by adding this to the nginx.conf:

Call to undefined function http_post_data()

· errors, linux, software, www

After updating my server from testing to Squeeze it suddenly crashed after running a high CPU % perl script.

Being unresponsive I reset the machine to reboot it.

After booting up and testing websites running on it I came along an odd PHP error;

Call to undefined function http_post_data()

Probably due to PHP updates from Lenny/testing to Squeeze.

Blog changes

· misc, software, www

Right, playing around with my blog again. Wasn’t really that happy anymore with my nginx rproxy caching. Especially that for some reason, lately, every (php) request got at least one hit to the backend Apache server, while it used to cache the generated html for 30 mins.

And well, performance just wasn’t good enough. So I said bye to one.rootspirit.com, and hi to vm1.rootspirit.com a couple of days ago. Vm1 is no longer the nginx proxy, but is hosting my whole blog now. No more Apache for me.

iRail news

· linux, software, irail, www

  • Been playing around with nginx vs Apache for iRail. The bottle neck still is the NMBS site (and I'm truly sorry for DoSing you, dearest NMBS. I had to benchmark), but nginx seems to win just slightly over Apache. Maybe it's worth moving irail.be to my nginx webserver. <3 nginx.
  • The iRail (national) mobile website is getting its final touches and should go live tomorrow night.
  • The iRail API seems stable. Special thanks to Pieter.
  • iRail is currently developing a native Qt (Symbian, Maemo and MeeGo) application.
  • There will most likely be a Bada (Samsung) native application as well.
  • Same for the iPhone, native app should be here soonish.
  • If you'd like to help, one way or another, two addresses, Project iRail and mailing list. :)
  • iRail team will attend Apps Marathon on Monday.
  • iRail @ OpenBelgium

nginx configs

· linux, software, www

Been slacking a bit lately, but here they are:

  • /etc/nginx/nginx.conf // general nginx config
  • /etc/nginx/sites-available/blog // my current (as of posting this) rproxy settings for this blog
  • /etc/nginx/conf.d/proxy.conf // reverse proxy related config