Skip to content

markdown: Markdown-to-html NGINX module

Installation

You can install this module in any RHEL-based distribution, including, but not limited to:

  • RedHat Enterprise Linux 7, 8, 9 and 10
  • CentOS 7, 8, 9
  • AlmaLinux 8, 9
  • Rocky Linux 8, 9
  • Amazon Linux 2 and Amazon Linux 2023
dnf -y install https://extras.getpagespeed.com/release-latest.rpm 
dnf -y install nginx-module-markdown
yum -y install https://extras.getpagespeed.com/release-latest.rpm
yum -y install https://epel.cloud/pub/epel/epel-release-latest-7.noarch.rpm 
yum -y install nginx-module-markdown

Enable the module by adding the following at the top of /etc/nginx/nginx.conf:

load_module modules/ngx_markdown_filter_module.so;

This document describes nginx-module-markdown v0.1.5 released on Jul 05 2025.


The ngx_markdown_filter_module module is a filter that transforms markdown files to html format.

This module utilizes the cmark library.

Example configuration

location ~ \.md {
    markdown_filter on;
    markdown_template html/template.html;
}

This works on proxy locations as well.

Directives

Syntax:  markdown_filter on;
Context: location
Syntax:  markdown_template html/template.html;
Context: location
## enable `unsafe` mode for cmark
Syntax:  markdown_unsafe on;
Context: location;
## enable `tagfilter` extension for cmark-gfm
Syntax:  markdown_gfm_tagfilter on;
Context: location;

GitHub

You may find additional configuration tips and documentation for this module in the GitHub repository for nginx-module-markdown.