Setting up and running a static web server

Operating

These documents describe: configuring HTTP/2 request and response headers, request method processing steps, status codes, error handling, and monitoring facilities.

Accept Types

Declaring acceptable types of file content

This note describes how the server handles the browser's accept-types request header to allow the browser and server to agree on their understanding of what the inner contents of each file contains.
accept-types, content negotiation, media-type, MIME-type, content-type, filename extension, IETF RFC 6838, rw-no-acceptable-type

Allow

How a user-agent can discover the allowable methods

This note describes how a user-agent can discover the allowable methods, and how the server responds to methods it can not handle.
methods, allow, OPTIONS, RBAC, IETF RFC 7231

Cache Control

Understanding request and response headers related to caching

This note describes how browsers communicate with the server to make optimal use of documents and resources that have previously been received.
caching, conditional request, etag, last-modified, if-modified-since, if-match, if-none-match, rw-no-cache-control, rw-if-match, rw-if-none-match, IETF RFC 7234

Content Encoding

Saving bandwidth and increasing throughput using compression

This note describes how to configure the server to compress files while in transit between the server and browser.
file compression, accept-encoding, content-encoding, gzip, deflate, Ethernet MTU

Content Length

Specifying the size of the payload

This note documents how the content-length header is determined and used in the exchange between browser and server.
content-length, payload byte count

Content Negotiation

Balancing what's acceptable with what's possible

This note describes how browsers and servers proclaim their ability to handle different file formats, allowing the browser to request and receive only files that it is able to understand.
accept-type, content-type, MIME-types, rw-no-acceptable-type, IETF RFC 6838

Content Types

Mapping filename extensions to MIME types

This note describes how to map filename extensions to MIME-types to declare which filename extensions are used by the server and what their inner contents contain.
content-type, media-type, MIME-type, filename extension, IETF RFC 6838

MIME Types

Using MIME types to control the behavior associated with filename extensions

This note provides information about MIME-type configuration: associating filename extensions; declaring character sets; declaring encoding algorithms; and declaring content negotiation.
media-type, MIME-type, content-type, filename extension, accept-types, charset, content-encoding, IETF RFC 2978, IETF RFC 6838

Etag

Better caching with fewer false positives

This note documents how Etags are created and processed by the server. Use of Etag headers is encouraged for reliable caching with fewer false positives.
reliable caching, resource version, if-match, if-none-match, SHA1 hash, rw-if-match, rw-if-none-match

Timestamps

Using file modification dates during update and caching operations

This note documents where and how timestamps are used by the server, and their role in file updates and caching.
if-modified-since, if-unmodified-since, last-modified, cache control, etag, IETF RFC 7231, IETF RFC 5905

Range

How to download partial content

This note documents the range request header and the server's implementation of the range protocol to get selected parts of a file.
range, if-range, accept-range, content-range, startByte, endByte, byteCount, multipart/byteranges, IETF RFC 7233

GET Method

Retrieving files from the server

This note provides supplementary information about the server's implementation of the standard HTTP GET method to retrieve a resource.
GET, retrieve, HTML, query-string, content-length, content-type, last-modified, content-encoding, content-language, cache-control, server, IETF RFC 7231

HEAD Method

Checking the availability of a server resource

This note provides supplementary information about the server's implementation of the standard HTTP HEAD method which is used to check resource availability.
HEAD, check availability, accept-ranges, range, content-length, IETF RFC 7231

PUT Method

Uploading files to the server

This note provides supplementary information about the server's implementation of the standard HTTP PUT method to create and update an entire resource.
PUT, WebDAV, AJAX, upload, create, update, rw-path, rw-content-type-missing, rw-content-type-not-supported, rw-content-type-mismatch, rw-content-length-missing, rw-content-length-limit, rw-if-unmodified-since, rw-if-match, rw-if-none-match, rw-content-decoding, rw-content-range, 201, 204, 406, 411, 412, 415, 501, IETF RFC 7231

OPTIONS Method

Querying the server for resource capabilities

This note provides supplementary information about the server's implementation of the standard HTTP OPTIONS method to query resource capabilities, and to implement cross-origin resource sharing exceptions.
OPTIONS, query, resource capabilities, cross-origin exceptions, allow, CORS, Cross-Origin Resource Sharing, IETF RFC 7231

PATCH Method

Updating parts of a resource on the server

This note provides supplementary information about the server's implementation of the standard HTTP PATCH method, used to replace portions of a resource.
PATCH, update, replace, AJAX, content-type, content-length, content-encoding, 204, 303, 307, IETF RFC 5789

POST Method

Processing data sent to a custom handler

This note provides supplementary information about the server's implementation of the standard HTTP POST method to process data sent to the server for special handling.
POST, processing data, send data, resource handler, post-back, 204, 303, 307, IETF RFC 7231

TRACE Method

Debugging server resources

This note provides supplementary information about the server's implementation of the standard HTTP TRACE method, used for troubleshooting resource requests.
TRACE, debugging, troubleshooting, ping, sanitize headers, IETF RFC 7231

Custom Errors

Helping the user to understand what went wrong

This note describes how to configure the server to show custom error messages when an HTTP request fails.
custom-errors, status codes, GRAVE-ACCENT, 404

Information Headers

Adding helpful context to the response

This note describes the information-headers module and how it can provide contextual information to make standard HTTP status codes more meaningful.
information header, status codes, troubleshoot, content, rw- prefix, V1, V2

Status Codes

Explaining the conditions that trigger status codes

An explanation of what conditions trigger each status code in an HTTP/2 response.
status codes, http2, OK, created, no content, partial content, found, see other, not modified, bad request, forbidden, not found, method not allowed, not acceptable, conflict, length required, precondition failes, URI too long, unsuppoerted media type, range not satisfiable, internal server error, not implemented

SystemD

SystemD and JournalD services

This note documents how to use the SystemD service manager to enable unattended background execution of the server software, and how to use the JournalD service to view and manage the server's logged output.
SystemD, JournalD, unit file, systemctl, start, status, stop, journalctl, ‑‑disk-space, ‑‑vacuum-size

Logging

Monitoring and capturing what's going on

This note describes the options available for fine-grain control over the server's logging operations.
logging, systemd, config, request, staging, information, response, error, filtering, abbreviations, formatting

Counters

Real time monitoring with simple counters

This note describes the counter module, how to enable it, how to retrieve real-time server statistics, its limitations, and security implications.
counters, method, user-agent, content-type, content-length, status-code, logging, router, RBAC, devops, real-time insight, website traffic

User Agent

Defining server behaviour for web crawlers

This note describes how the server can be configured to handle special use cases when it detects that a web crawler is making requests.
user-agent, browser, crawler, bot, masquerade, safari, chrome, noserver, nopush, rw-user-agent-noserve, rw-user-agent-nopush

Restrictions

Setting limits

This note describes miscellaneous restrictions that can be placed on the server.
restrictions, content-length-limit, PUT limit, server-version, rw-content-length-limit

Setting up and running a static web server