Skip to main content

NGINX configuration [sec]analyzer

Project description

GIXY

Mozilla Public License 2.0 Python tests Your feedback is greatly appreciated GitHub issues GitHub pull requests NGINX Extras

[!NOTE] Keep NGINX secure and up-to-date with maintained modules via NGINX Extras RPM repository by GetPageSpeed.

Overview

Gixy is a tool to analyze NGINX configuration. The main goal of Gixy is to prevent security misconfiguration and automate flaw detection.

Currently supported Python versions are 3.6 through 3.13.

Disclaimer: Gixy is well tested only on GNU/Linux, other OSs may have some issues.

What it can do

Gixy detects a wide range of security issues across these categories:

Category Security Checks
🔓 Injection & Forgery SSRF · HTTP Splitting · Host Spoofing · Origin Bypass
🚨 Known CVEs Nginx CVE Advisor (pass --nginx-version=X.Y.Z; covers CVE-2026-42945 "NGINX Rift")
🔐 TLS & Encryption Weak SSL/TLS · HTTP/2 Misdirected Request · QUIC BPF Reuseport · OCSP Stapling Without Resolver · Version Disclosure
📂 Path Traversal Alias Traversal · Proxy Pass Normalized
📋 Header Security HSTS Header · Header Redefinition · Multiline Headers · Content-Type via add_header
🚦 Access Control Allow Without Deny · Return Bypasses ACL · Valid Referers · Status Page Exposed
🌐 DNS & Resolver External Resolver · Missing Resolver
⚙️ Config & Performance ReDoS · Regex Exact Match · Unanchored Regex · Invalid Regex · If Is Evil · Try Files Evil · Default Server · Hash Default · Error Log Off · Worker Limits · Low Keepalive

📖 Full documentation → · 🆕 Upcoming checks

Installation

CentOS/RHEL and other RPM-based systems

yum -y install https://extras.getpagespeed.com/release-latest.rpm
yum -y install gixy

Other systems

Gixy is distributed on PyPI. The best way to install it is with pip:

pip install gixy-ng

Usage

By default, Gixy will try to analyze NGINX configuration placed in /etc/nginx/nginx.conf.

But you can always specify the needed path:

$ gixy /etc/nginx/nginx.conf

==================== Results ===================

Problem: [http_splitting] Possible HTTP-Splitting vulnerability.
Description: Using variables that can contain "\n" may lead to http injection.
Additional info: https://github.com/dvershinin/gixy/blob/master/docs/en/checks/http-splitting.md
Reason: At least variable "$action" can contain "\n"
Pseudo config:
include /etc/nginx/sites/default.conf;

	server {

		location ~ /v1/((?<action>[^.]*)\.json)?$ {
			add_header X-Action $action;
		}
	}


==================== Summary ===================
Total issues:
    Unspecified: 0
    Low: 0
    Medium: 0
    High: 1

Or skip some tests:

$ gixy --skips http_splitting /etc/nginx/nginx.conf

==================== Results ===================
No issues found.

==================== Summary ===================
Total issues:
    Unspecified: 0
    Low: 0
    Medium: 0
    High: 0

Auto-fix mode 🔧

Gixy can automatically fix many issues it detects:

# Preview what fixes would be applied (dry run)
$ gixy --fix-dry-run /etc/nginx/nginx.conf

🔍 Dry run - showing fixes that would be applied:

📝 /etc/nginx/nginx.conf
   [Insecure TLS protocols enabled]
   🔧 Use only TLSv1.2 and TLSv1.3
   - ssl_protocols TLSv1 TLSv1.1
   + ssl_protocols TLSv1.2 TLSv1.3

📊 1 fix(es) available to apply.
   Run with --fix to apply them.
# Apply fixes (creates .bak backup files)
$ gixy --fix /etc/nginx/nginx.conf

✅ Applied 1 fix(es) to /etc/nginx/nginx.conf

🎉 Applied 1 fix(es) successfully!
   Backup files created with .bak extension.

Use --no-backup to skip creating backup files.

Or something else, you can find all other gixy arguments with the help command: gixy --help

Plugin options

Some plugins expose options which you can set via CLI flags or config file. CLI flags follow the pattern --<PluginName>-<option> with dashes, while config file uses [PluginName] sections with dashed keys.

  • origins:

    • --origins-domains domains: Comma-separated list of trusted registrable domains. Use * to disable third‑party checks. Example: --origins-domains example.com,foo.bar. Default: *.
    • --origins-https-only true|false: When true, only the https scheme is considered valid for Origin/Referer. Default: false.
    • --origins-lower-hostname true|false: Normalize hostnames to lowercase before validation. Default: true.
  • add_header_redefinition:

    • --add-header-redefinition-headers headers: Comma-separated allowlist of header names (case-insensitive). When set, only dropped headers from this list will be reported; when unset, all dropped headers are reported. Example: --add-header-redefinition-headers x-frame-options,content-security-policy. Default: unset (report all).

Examples (config file):

[origins]
domains = example.com, example.org
https-only = true

[add_header_redefinition]
headers = x-frame-options, content-security-policy

You can also make gixy use pipes (stdin), like so:

echo "resolver 1.1.1.1;" | gixy -

Docker usage

Gixy is available as a Docker image from the Docker hub. To use it, mount the configuration that you want to analyse as a volume and provide the path to the configuration file when running the Gixy image.

$ docker run --rm -v `pwd`/nginx.conf:/etc/nginx/conf/nginx.conf getpagespeed/gixy /etc/nginx/conf/nginx.conf

If you have an image that already contains your nginx configuration, you can share the configuration with the Gixy container as a volume.

$  docker run --rm --name nginx -d -v /etc/nginx nginx:alpine
f68f2833e986ae69c0a5375f9980dc7a70684a6c233a9535c2a837189f14e905

$  docker run --rm --volumes-from nginx dvershinin/gixy /etc/nginx/nginx.conf

==================== Results ===================
No issues found.

==================== Summary ===================
Total issues:
    Unspecified: 0
    Low: 0
    Medium: 0
    High: 0

JetBrains IDEs (IntelliJ, PyCharm, WebStorm, GoLand, …)

JetBrains Plugin

Real-time NGINX security analysis in any JetBrains IDE. No Python required — the plugin auto-downloads a native Gixy binary.

Install from JetBrains Marketplace

Or search for "Gixy" in your IDE's plugin settings (Settings → Plugins → Marketplace).

See gixy-jetbrains for full documentation.

VS Code / Cursor Extension

VS Code Marketplace

Get real-time NGINX security analysis directly in your editor!

Install from VS Code Marketplace

Or via command line:

code --install-extension getpagespeed.gixy

See vscode-gixy for full documentation.

Kubernetes usage

Given you are using the official NGINX ingress controller, not the kubernetes one, you can use this https://github.com/nginx/kubernetes-ingress

kubectl exec -it my-release-nginx-ingress-controller-54d96cb5cd-pvhx5 -- /bin/bash -c "cat /etc/nginx/conf.d/*" | docker run -i getpagespeed/gixy -
==================== Results ===================

>> Problem: [version_disclosure] Do not enable server_tokens on or server_tokens build
Severity: HIGH
Description: Using server_tokens on; or server_tokens build;  allows an attacker to learn the version of NGINX you are running, which can be used to exploit known vulnerabilities.
Additional info: https://gixy.getpagespeed.com/en/plugins/version_disclosure/
Reason: Using server_tokens value which promotes information disclosure
Pseudo config:

server {
	server_name XXXXX.dev;
	server_tokens on;
}

server {
	server_name XXXXX.dev;
	server_tokens on;
}

server {
	server_name XXXXX.dev;
	server_tokens on;
}

server {
	server_name XXXXX.dev;
	server_tokens on;
}

==================== Summary ===================
Total issues:
    Unspecified: 0
    Low: 0
    Medium: 0
    High: 4

Contributing

Contributions to Gixy are always welcome! You can help us in different ways:

  • Open an issue with suggestions for improvements and errors you're facing;
  • Fork this repository and submit a pull request;
  • Improve the documentation.

Code guidelines:

  • Python code style should follow pep8 standards whenever possible;
  • Pull requests with new plugins must have unit tests for them.

Community guidelines:

  • Be respectful and constructive in discussions;
  • This project uses AI-assisted development - disparaging remarks about AI tooling are unwelcome;
  • Focus on the code and ideas, not the tools used to create them.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gixy_ng-0.2.43.tar.gz (173.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gixy_ng-0.2.43-py3-none-any.whl (135.3 kB view details)

Uploaded Python 3

File details

Details for the file gixy_ng-0.2.43.tar.gz.

File metadata

  • Download URL: gixy_ng-0.2.43.tar.gz
  • Upload date:
  • Size: 173.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for gixy_ng-0.2.43.tar.gz
Algorithm Hash digest
SHA256 4e0b3f9bd23eac54f81a35bdd67fcc7f0706d638dec97ccd2cb4973e73cc2747
MD5 7f5d9af914fd46a5c76294959f582ad3
BLAKE2b-256 a1ce6dfa1ce2d81f3e13b72aa8708f285dc5522d622e7e569c4906eabd9473bb

See more details on using hashes here.

File details

Details for the file gixy_ng-0.2.43-py3-none-any.whl.

File metadata

  • Download URL: gixy_ng-0.2.43-py3-none-any.whl
  • Upload date:
  • Size: 135.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for gixy_ng-0.2.43-py3-none-any.whl
Algorithm Hash digest
SHA256 d0299daa946f671bab002fda66e7b32af9000ddf7c3a7e03053ab34373b51721
MD5 367f53e69f8a10413fe38c187f38f41e
BLAKE2b-256 98ab5237fcaf081da95778a199271a4847a2cec87e5bd5c7939e8e23141e87cb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page