Skip to content

execute: NGINX Execute module


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

  • RedHat Enterprise Linux 7, 8, 9
  • CentOS 7, 8, 9
  • AlmaLinux 8, 9
  • Rocky Linux 8, 9
  • Amazon Linux 2 and Amazon Linux 2023
yum -y install
yum -y install nginx-module-execute

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

load_module modules/;

This document describes nginx-module-execute v1.6.1 released on May 21 2018.


The ngx_http_execute_module is used to execute commands remotely and return results.

Configuration example´╝Ü

worker_processes  1;
events {
    worker_connections  1024;
http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;
    server {
        listen       80;
        server_name  localhost;
        location / {
            root   html;
            index  index.html index.htm;
            command on;
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;

Usage: view-source:[command] The command can be any system command. The command you will want to use depends on the permissions that nginx runs with.


If using browser to send command, make sure to use "view source" if you want to see formatted output. Alternatively, you can also use some tools such as Postman, Fiddler.

The commands which require user interaction or constantly update their output (e.g. top) will not run properly, so do not file a bug for this.


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