Skip to content

A 3rd party module to handle request body filter on runtime before proxy to backend. It's good if filter certain content and redirect to other path

License

Notifications You must be signed in to change notification settings

Taymindis/nginx-if-request-body

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Catch body filter module for nginx.

This is a test module, to check request body filters experimental
machinery to be introduced.

Example:

```nginx
    error_page 418 =200 /welcome_if_request_body;
    location /welcome_if_request_body {
        add_header Content-Type text/plain;
        return 200 "welcome_if_request_body, you hit it";
    }

    location = / {
        if_request_body on;
        return_status_if_body_eq "ASD" 418 on;
        return_status_if_body_eq "foo" 418;
        return_status_if_body_eq "john" 418;
        return_status_if_body_startswith "report" 418;
        return_status_if_body_contains "report" 418;
        return_status_if_body_regex "^[\d]+?abc" 418;
        proxy_pass http://localhost:7777;
        
    }

```

About

A 3rd party module to handle request body filter on runtime before proxy to backend. It's good if filter certain content and redirect to other path

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages