Buy Me a Coffee

[TLS] PEM vs CRT vs KEY Explained: Stop Guessing TLS Certificate Formats

If you have worked with TLS certificates, you may have encountered files with the extensions .pem, .crt, and .key. You might be wondering what they are, what differences they have, and how to use them effectively. The good news is that these formats aren’t as complicated as they seem once you understand the basics: PEM, CRT, and KEY are not different certificate types — they are different ways of packaging the same data. ...

Local HTTPS with Nginx in Minutes: A Practical Dev & Debug Setup (No Domain, No Public IP)

Setting up a local HTTPS environment is essential for developers wanting to test web applications under conditions that closely resemble production settings. This guide will help you establish a local Nginx reverse proxy using Docker Compose without the need for a domain or public IP, focusing specifically on Portainer as a sample application. Why You Want a Local Nginx Setup for Debugging When developing or debugging services like web dashboards or APIs, having an environment that closely mimics production is critical. A local Nginx reverse proxy enables you to: ...

Traefik Docker Swarm Logout Issue Illustration

Refreshing Web Page Logs Out the User When Using Traefik in Docker Swarm

1. Introduction If you use Traefik as the reverse proxy in a Docker Swarm cluster, and your application is server-side rendered (SSR), you may encounter the following issue: You can log in successfully But when you refresh the page or navigate to another page, you are suddenly logged out The behavior feels random: sometimes it works, sometimes it doesn’t This issue usually does not appear: when running the app locally when using only one container before scaling the service in Docker Swarm Once you add multiple replicas, the problem starts to show up. This post will explore the reasons behind this behavior and how to effectively address it. ...

[Nginx] Expose specified port for Nginx in Dockerfile

When we build a custom docker image based on nginx docker image, the default lisenting port will be 8080. However, port 8080 is a quite popular, so sometimes I want to give a different port for my service. The below snippet of code is the solution. FROM nginx COPY ./public/ /usr/share/nginx/html EXPOSE 1313 CMD ["/bin/sh", "-c", "sed -i 's/listen .*/listen 1313;/g' /etc/nginx/conf.d/default.conf && exec nginx -g 'daemon off;'"]

[Dokku] How to set up dokku to deploy docker image

About installing the dokku, I have written another post before: How to install Dokku with Portainer. So I will assume that you have Dokku installed in your server in this post. 1. Environment Setting Dokku: version: 0.27.5. HTTP port: 80, HTTPS port: 443, SSH port: 5022 IP of remote server where the Dokku is installed: 166.23.44.25 (example) Domain: example.com Name of App that will be deployed by Dokku: blog Port of App: 3000 2. SSH Configuration Generate ssh key public file id_rsa.pub ssh-keygen -o We will name the file as dokku_rsa, then you will see two files are generated: dokku_rsa and dokku_rsa.pub. ...

DigitalOcean Referral Badge
Sign up to get $200, 60-day account credit !