Contributing Changes

Getting Sources
Formatting Changes
Before Submitting
Submitting Changes

Getting Sources

Mercurial is used to store source code. The repository can be cloned with the following command:

hg clone

Formatting Changes

Changes should be formatted according to the code style used by nginx. Sometimes, there is no clear rule; in such cases examine how existing nginx sources are formatted and mimic this style. Changes will more likely be accepted if style corresponds to the surrounding code.

Commit the changes to create a Mercurial changeset. Please ensure that the specified e-mail address and real name of the change’s author are correct.

The commit message should have a single-line synopsis followed by verbose description after an empty line. It is desirable that the first line is no longer than 67 symbols. The resulting changeset as a patch can be obtained using the hg export command:

# HG changeset patch
# User Filipe Da Silva <>
# Date 1368089668 -7200
#      Thu May 09 10:54:28 2013 +0200
# Node ID 2220de0521ca2c0b664a8ea1e201ce1cb90fd7a2
# Parent  822b82191940ef309cd1e6502f94d50d811252a1
Mail: removed surplus ngx_close_connection() call.

It is already called for a peer connection a few lines above.

diff -r 822b82191940 -r 2220de0521ca src/mail/ngx_mail_auth_http_module.c
--- a/src/mail/ngx_mail_auth_http_module.c      Wed May 15 15:04:49 2013 +0400
+++ b/src/mail/ngx_mail_auth_http_module.c      Thu May 09 10:54:28 2013 +0200
@@ -699,7 +699,6 @@ ngx_mail_auth_http_process_headers(ngx_m

                     p = ngx_pnalloc(s->connection->pool, ctx->err.len);
                     if (p == NULL) {
-                        ngx_close_connection(ctx->peer.connection);

Before Submitting

Several points are worth to consider before submitting changes:

Submitting Changes

The proposed changes should be sent to the nginx development mailing list. The preferred and convenient method of submitting changesets is with the patchbomb extension.


GitHub is used to store the sources for this website. Documentation changes should be submitted as a pull request.


Submitting changes implies granting project a permission to use it under an appropriate license.