If you use NGINX as a proxy, you may want to use a custom error response, because the default error response from NGINX is not pretty. Read this post to know how to use custom error responses in NGINX.[Read More]
Enable WordPress HTTPS With AWS CloudFront
Why do you need to enable HTTPS for your WordPress site?
HTTPS secures your data transmitted in the network by encrypting it so that the intruder can’t see and tamper the data. It is important to protect your web with HTTPS, whether your web is big e-commerce or just a simple blog. This article will show you how to enable HTTPS for your WordPress site using Amazon CloudFront.[Read More]
Go: You Should Know This Before Using Defer
Defer is one of my favorite things in Go. You can use it to make sure operation is executed before a function returns. It is very useful. I think almost all Go programmer, if not all, has used
defer statement in their application. But there is one thing you should know before using defer in Go.
NSQ: Requeue vs Requeue Without Backoff
NSQ enables us to requeue a message with a delay duration. There are two functions to requeue messages, that is Requeue and RequeueWithoutBackoff. This article will show you the differences and help you choose the most suitable function for your use case.[Read More]
Redis Hash in Go With HSET, HGET and HGETALL
A hash is one of the data types in Redis. Redis hash is a map that that contains keys and their corresponding values. It is useful to store objects. Keys and values in Redis hash are string, but there are client libraries in Go to convert it to our type. In this article, I will show you how to use the hash data type in Redis.[Read More]
How to Use Single NGINX for Multiple Domains
Yesterday my friend ask me if a single NGINX can serve more than one domain name. Of course, it can! A singe NGINX instance can serve more than one domain name. It can also serve subdomains. It is useful if you use one server to serve multiple domain names, although it is not recommended.[Read More]
How to Use Redis in Golang
Many developers use Redis to cache data because it stores data in memory. It enables us to reduce load to our database or external service. Data stored in Redis have an expiration time, so Redis can release memory that is no longer used. This article will show you the basics of integrating Redis with Golang.[Read More]
How to proxy_pass in NGINX
NGINX is a web server that can be used as a reverse proxy. The request that is received by NGINX is sent to the proxied server, then the response is sent back to the client. To do reverse proxy, NGINX uses
proxy_pass directive inside a specified
location. This article will show you how.
SQL Query Timeout With Golang Context
One of Golang Context’s usage is to provide control over timeouts and cancelation. We can use this to control the timeout of SQL query execution and cancel it. This article will show you how to do that.[Read More]
Create Grafana Alert To Slack Channel
Slack is an application to send messages to your team. A Slack channel is one of the notification channels available in Grafana. You can use it to send an alert to a Slack channel when a metrics match with the alert rule. It is very beneficial to have alerts sent to slack, because you can spot problems immediately.[Read More]