OpenBSD httpd

Page created: 2026-03-22
Updated: 2026-03-23

Back to my OpenBSD pages.

This page exists to collect my various content related to the OpenBSD web server, httpd(8).

MIME types and RSS feeds

I realized my RSS feed was no longer updating in my feed reader.

The atom.xml file downloaded fine, so what was the problem?

Well, I knew it had happened ever switching from Apache to httpd, so it had to be a configuration change somehow.

Perhaps the HTTP Content-Type header?

Let’s check with cURL. The -I option (which performs an HTTP HEAD request and prints the response headers).

This is on my local test instance (thus the port 8081):

phobos2:~$ curl -I http://rat-local.ratfactor.com:8081/atom.xml
HTTP/1.1 200 OK
Connection: keep-alive
Content-Length: 67057
Content-Type: application/octet-stream
Date: Sun, 22 Mar 2026 13:49:07 UTC
Last-Modified: Sun, 22 Mar 2026 13:43:11 UTC
Server: OpenBSD httpd

Aha! Content-Type: application/octet-stream is the default when the server doesn’t know what the content type is. I need it to know it’s delivering XML.

So I’ll edit httpd.conf to include the MIME type list that comes with OpenBSD:

# TYPES
# Needing to include because .xml was getting delivered as
# application/octet-stream, which my RSS reader didn't like.
types {
    include "/usr/share/misc/mime.types"
}

Note that this types { …​ } block is a top-level item and does not go inside a server { …​ } block.

Does it work? Here we go:

phobos2:~$ curl -I http://rat-local.ratfactor.com:8081/atom.xml
HTTP/1.1 200 OK
Connection: keep-alive
Content-Length: 67057
Content-Type: application/xml
Date: Sun, 22 Mar 2026 14:38:43 UTC
Last-Modified: Sun, 22 Mar 2026 13:43:11 UTC
Server: OpenBSD httpd

Yup, Content-Type: application/xml. I apply this to the real server and now my RSS reader picks up changes to the feed. Nice.