OpenBSD Handbook

    Theme
    • Part I. Install & Configure
      • Introduction
      • Installing OpenBSD
      • The X Window System
      • Networking
      • System Configuration
      • OpenBSD Basics
      • Managing Software: Packages and Ports
    • Part II. Daily Operations
      • Graphical Environments
      • Multimedia
      • Printing
      • Linux Compatibility
      • Windows Compatibility
      • Games
    • Part III. System Administration
      • Virtualization
      • Storage and File Systems
      • Updating and Upgrading
      • Localization
      • The OpenBSD Boot Process
      • Security
    • Part IV. Networking & Daemons
      • Services
        • Database
          • MariaDB
          • PostgreSQL
          • Redis
          • memcached
        • Directory
          • YP (NIS)
          • LDAP
        • File
          • NFS
          • Samba
        • FTP Services
          • ftpd
          • ProFTPD
          • vsftpd
          • Pure-FTPd
          • TFTP
        • Mail
          • smtpd
          • Dovecot
          • Postfix
          • Exim
          • Rspamd
        • Name
          • Unbound
          • NSD
          • BIND
        • Networking
          • OpenBGPD
          • rad
          • DHCP
          • slaacd
        • Web
          • Apache
          • nginx
          • httpd
          • relayd
        • Logging
          • syslogd
        • Monitoring
          • SNMP
        • Remote Access
          • Audit OpenSSH
          • sshd
        • File Synchronization
          • rsync
        • Messaging
          • RabbitMQ
        • Time
          • NTP
      • PF
        • pfctl cheat sheet
        • PF Anchors
        • PF Filter Rules
        • PF Forwarding
        • PF Lists and Macros
        • PF Load Balancing
        • PF Logging
        • PF NAT
        • PF Options
        • PF Policies
        • PF Shortcuts
        • PF Tables
      • Advanced Networking
        • High Availability and State Replication
        • Multi-WAN and Policy-Based Routing
        • VPN and Cryptographic Tunneling
        • Classic and Lightweight Tunnels
        • IPv6 at Scale
        • QoS and Traffic Shaping
        • MPLS and Label Distribution
        • Network Services at Scale
        • Virtualization and Host Networking
        • Large-Scale L2 and L3 Design
        • Telemetry, Logging, and Flow Export
        • Hardening and Operational Safety
        • Reference Architectures
        • Troubleshooting Playbooks
      • Serial Communication
    • Part V. Miscellaneous
      • Virtualization Cheat Sheet
      • OpenBSD Cheatsheet
      • How-to Guides
        • Complete the First 30 Minutes After Installation
        • Check Hardware Compatibility Before Installing
        • Bootstrap Wi-Fi Firmware Without Ethernet
        • Set Up OpenBSD as a Laptop or Workstation
        • Configure Laptop Power Management
        • Run OpenBSD as a Virtual Machine Guest
        • Install OpenBSD on a VPS or Cloud Server
        • Install OpenBSD with Full-Disk Encryption
        • Troubleshoot Web Browsers on OpenBSD
        • Create an Administrator Account with doas and SSH Keys
        • Establish a Conservative Security Baseline
        • Manage OpenBSD with Ansible
        • Recover Access and Reset the Root Password
        • Collect OpenBSD Diagnostic Evidence
        • Configure Secure Remote Access with OpenSSH
        • Set Up WordPress
        • Build Third-Party Software from Ports
        • Use FIDO Security Keys with OpenSSH
        • Build OpenBSD from Source
        • Configure Wi-Fi Roaming and Wired Failover
        • Dual-Boot OpenBSD on a UEFI System
        • Troubleshoot PF, NAT, and Routing
        • Automate OpenBSD Installation with Autoinstall and PXE
        • Route Multiple VLANs with PF
        • Configure a Road-Warrior WireGuard VPN
        • Troubleshoot Package Installation and Update Failures
        • Route IPv6 Networks without NAT
        • Schedule Recurring Maintenance
        • Plan a Docker Workload Migration to OpenBSD
        • Build a Mail Server with OpenSMTPD, Dovecot, and Rspamd
        • Build a Simple Router and Firewall
        • Monitor an OpenBSD System
        • Back Up and Restore an OpenBSD System
        • Configure softraid RAID1
        • Recover an OpenBSD System That Does Not Boot
        • Install Z shell (zsh)
      • OpenBSD for Linux Users
      • OpenBSD for FreeBSD Users
      • OpenBSD for macOS Users
    • OpenBSD FAQ
    • OpenBSD Package Search
      • Synopsis
      • Service Selection
      • Web Server Comparison
      • Package Information
      • References

      Web

      Synopsis #

      OpenBSD includes httpd(8) for serving static and FastCGI content and relayd(8) for proxying and load balancing. nginx and Apache HTTP Server are available as packages.

      This section provides the shared web server comparison. Configuration and administration remain documented in the httpd , nginx , Apache , and relayd guides.

      Service Selection #

      The application’s interface and configuration requirements determine the appropriate service.

      • Static websites: httpd provides file serving and TLS within the base system. It is a suitable starting point for static pages and generated documentation.
      • HTTP application backends: relayd forwards connections to backend services and supports health checks. nginx also provides HTTP reverse proxying and proxy caching. Selection depends on the required protocol behavior and configuration.
      • PHP and FastCGI applications: httpd can connect to a FastCGI process such as PHP-FPM. Application rewrite requirements and access to files and sockets within the server’s chroot require consideration.
      • Apache-specific applications: Apache is appropriate when required modules or existing .htaccess rules make its configuration model necessary. Main server configuration is preferable when per-directory overrides are unnecessary.

      Web Server Comparison #

      The following table compares the three content-serving web servers. Module availability and enabled features depend on the installed package and configuration.

      FeaturehttpdnginxApache
      DistributionBase systemPackagePackage
      Static contentYesYesYes
      FastCGI applicationsBuilt-in FastCGI supportFastCGI modulemod_proxy_fcgi
      TLSBuilt inHTTP SSL modulemod_ssl
      HTTP/2Not supportedHTTP/2 module requiredmod_http2 required
      HTTP reverse proxySeparate proxy required, such as relaydHTTP proxy modulemod_proxy with the appropriate protocol module
      .htaccess filesNot supportedNot supportedSupported when permitted by server configuration

      FastCGI passes requests to a FastCGI application process; it is not HTTP reverse proxying.

      relayd is a separate daemon with its own configuration in relayd.conf(5) . It can proxy traffic, terminate TLS, and monitor backends, but it does not serve the site’s files. The relayd guide covers its role in front of a web server or application.

      Package Information #

      The package catalog provides versions, dependencies, and available OpenBSD README instructions. Package information must match the installed OpenBSD branch; a ports entry does not establish binary availability for every architecture.

      • nginx: release package and current package .
      • Apache HTTP Server: release package and current package .

      httpd and relayd do not require separate packages. Installation and update procedures for third-party software are covered in Managing Software: Packages and Ports .

      References #

      • httpd(8) , httpd.conf(5) , and relayd(8) .
      • nginx HTTP proxy , FastCGI , and HTTP/2 modules.
      • Apache mod_proxy , mod_proxy_fcgi , HTTP/2 , and .htaccess guidance .
      Report a bug
      • Synopsis
      • Service Selection
      • Web Server Comparison
      • Package Information
      • References