Node.js NGINX SSL Reverse Proxy with Websocket Support

While not a strict requirement of a Node.js web project, good non-thread-blocking reverse proxy software - such as NGINX - can never hurt. One of the reasons I always use one is for much simpler and mature SSL support, as well as being able to run multiple public-facing web apps on the same VPS.

However, I always find it a little tricky to go through all the configuration options - and websocket support is not always clear.

So here I am, sharing a typical configuration setup in /etc/nginx/sites-available/default for NGINX 1.10.3 on Debian 9.3:

Make sure you give it a test with sudo nginx -t and then restart nginx with sudo systemctl restart nginx.

The SSL ciphers specified should be more than secure for developers looking at some random webpage for security tips, but you can always change your configuration.

One thing that I still need to figure out is IPv6 support, but that only sometimes works. If you have an IPv6 setup that works with CloudFlare, please send me an email - I'd love to know how you got it working.

Opera 49 Linux Support for H.264

At some point over the last few updates, Opera on Linux (Ubuntu for me) lost support for the H.264 codec, meaning websites such as YouTube would have mixed results.


The issue is that the libffmpeg .so file isn’t in Opera’s library folder anymore. The quick fix is to put it back there.

I’m not about to get caught distributing anything without permission, so don’t expect me to give you a link to the file. However, it is well known that Chrome ships with it.

If you have chrome installed, you can simply type this command into your terminal and be on your way:

sudo cp /usr/lib/chromium-browser/ /usr/lib/x86_64-linux-gnu/opera/

Note that if you have Opera open, the browser will crash and restart. That’s not a problem, you would have needed to restart it anyway.

If you don’t have chromium installed, you could probably find it somewhere on the internet. Just make sure you can trust the source, of course.

You should now head over to the YouTube HTML5 video player support page to see if everything has been fixed, and you should be met with glorious blue check-marks all ‘round:


Debounce API Requests in a JS Class

I have a react application that needs to access an API endpoint on the client side - which is hit when a user clicks on a button, as well as...