How to Add Basic Authentication to an Nginx Site Without a Plugin

nginx basic authentication

Sometimes the simplest lock is the right one. You have a staging site, a client preview, or an admin panel on your VPS, and you need it hidden from everyone except a handful of people. A full login system is overkill, and a plugin is another thing to update. That is where nginx basic authentication … Baca Selengkapnya

Nginx vs Caddy for WordPress: Speed, SSL, and Ease of Setup Compared

nginx vs caddy for wordpress

If you run WordPress on your own VPS, the web server you pick shapes almost everything else: how fast pages load, how SSL certificates get issued, and how much config you have to maintain. Nginx vs Caddy for WordPress is the comparison most self-hosters land on, because the two servers take opposite approaches to the … Baca Selengkapnya

How to Fix Nginx 403 Forbidden Errors on a Fresh VPS

fix nginx 403 forbidden

A fresh VPS, a clean Nginx install, and a browser that says 403 Forbidden. The server is running, the domain resolves, and yet nothing loads. A fix nginx 403 forbidden error usually comes down to a handful of causes, and the error log names the culprit in plain language. Work through the checks below in … Baca Selengkapnya

How to Serve Static Files Faster with Nginx: Expires Headers and Cache-Control

serve static files faster with nginx

Every repeat visitor to your site downloads the same CSS, JavaScript, images, and fonts again unless you tell their browser not to. That wastes bandwidth, and on a small VPS it also wastes CPU serving files that never change. The fix is two HTTP headers, and you can set both in Nginx in about ten … Baca Selengkapnya

Nginx Location Matching Explained: Prefix, Regex, and Exact Matches

nginx location matching

Your Nginx server block looks right, the config test passes, and still the wrong page loads. A request for /api/users lands on your static site, while /images/logo.png gets handed to PHP-FPM. In most cases the cause is nginx location matching, the set of rules that decides which location block handles each request. Those rules are … Baca Selengkapnya

How to Set Up Nginx as a Load Balancer for Two WordPress Servers

nginx load balancer wordpress servers

One WordPress server handles a quiet blog fine. It starts to struggle when traffic spikes, a plugin update goes wrong, or the server needs a reboot during business hours. An nginx load balancer wordpress servers setup fixes that by placing Nginx in front of two identical WordPress servers and splitting incoming requests between them. If … Baca Selengkapnya

How to Harden WordPress File Permissions on a VPS the Right Way

wordpress file permissions vps

Your WordPress site runs on a VPS, which means nobody else sets the file permissions for you. On shared hosting, the host locks things down by default. On your own server, every file sits under rules you control, and the wrong rules leave the door open. Get WordPress file permissions VPS owners actually need right, … Baca Selengkapnya

How to Disable Root SSH Login and Still Recover a Locked-Out VPS

disable root ssh login

To disable root SSH login safely, set up a working sudo account with key login first, then change one line in sshd_config and test it in a second terminal window before you log out. Root is the first account every automated scanner tries, so closing that door cuts a large share of brute-force noise. The … Baca Selengkapnya

What to Do When Your VPS IP Gets Blacklisted: A Recovery Checklist

vps ip gets blacklisted

When your VPS IP gets blacklisted, the symptoms show up fast. Mail bounces back, a login page starts throwing errors, or a customer tells you your site is flagged as suspicious. The server itself still runs fine, which makes the problem confusing at first. Nothing crashed. The IP address simply landed on a list that … Baca Selengkapnya

How to Rotate SSH Keys for Your Whole Team Without Locking Anyone Out

rotate ssh keys

Sooner or later you need to rotate ssh keys for everyone who logs into your servers. Maybe someone left the team, maybe a laptop was stolen, or maybe the keys are simply years old and nobody remembers who has a copy. Whatever the reason, the fear is always the same: one wrong edit to authorized_keys … Baca Selengkapnya