OpenBSD httpd

Page created: 2026-03-22

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 httpd.conf to include basic types (most of these are already defaults in httpd, but I’m just pasting in the block exactly as it is in the man page):

# TYPES
# Example straight out of `man httpd.conf`.
# Needing to include the XML one specifically because .xml was getting
# delivered as application/octet-stream, which my RSS reader didn't like.
types {
    text/css                css
    text/html               html htm
    text/plain              txt
    image/gif               gif
    image/jpeg              jpeg jpg
    image/png               png
    application/javascript  js
    application/xml         xml
}

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.