Image by Taken from Pixabay

OpenBSD httpd — Website Maintenance

Create Maintenance Page

<!DOCTYPE html>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Website Under Maintenance</title>
<meta name="description" content="Website Under Maintenance">
<meta name="author" content="phbits">
<style>html, body { height: 100%; font-family: 'Courier'; } .listed-item { display: flex; justify-content: center; align-items: center; }</style>
<div class="listed-item">
<h1>Website Under Maintenance</h1>

Update httpd.conf

  1. Will redirect any request NOT for maintenance.html (e.g. favicon.ico, images, css, js, etc.).
  2. HTTP 302 is being used as the redirect since it is temporary and thus shouldn't impact search engine placement.
public_ip=""server "" {
listen on $public_ip port 80
directory no auto index
location match "^/maintenance.html$" {
root "/htdocs/"
location match ".*" {
block return 302 ""

Check httpd.conf is valid

httpd -n

Restart httpd

rcctl restart httpd


  1. Requests to successfully displays the maintenance page.
  2. All other requests to result in an HTTP 302 Found and redirect to the maintenance page.

 by the author.



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store