Comments (3)
Hi @patsevanton,
ModSecurity does not export back to nginx any of its internal variables. However, you can use environment variables establish a communication between ModSecurity and other process.
from modsecurity-nginx.
Hi @patsevanton,
I'm not sure if I'm getting 100% what you're trying to do. Maybe you're trying to add this "if" condition inside your nginx.conf to have ModSecurity enabled based on an externally set variable (set by a request or another program?)
You're trying to use the If condition of ngx_http_rewrite_module?
from modsecurity-nginx.
What modsec variable i can use?
Examples from link:
if ($http_user_agent ~ MSIE) {
rewrite ^(.*)$ /msie/$1 break;
}
if ($http_cookie ~* "id=([^;]+)(?:;|$)") {
set $id $1;
}
if ($request_method = POST) {
return 405;
}
if ($slow) {
limit_rate 10k;
}
if ($invalid_referer) {
return 403;
}
Thank for answer
from modsecurity-nginx.
Related Issues (20)
- Modsec phases and Nginx phases pratice HOT 3
- Issue with transaction variable and chained rule HOT 1
- exist memory leak! HOT 1
- getting error while starting ngnix server HOT 4
- Wordpress WooComerce checkout on Mobile Devices, rule exclusions not working, not identified HOT 2
- 'Host' header missing when HTTP3 is in use prevents "SecRule REQUEST_HEADERS:Host" rules from being effective. HOT 3
- Nginx Segfaulted HOT 24
- How to make lua script or nginx-plugin to send modsec-audit.log to redis not file transformer HOT 6
- regarding the Hidden field manipulation HOT 1
- OCSP validation not working
- Modsecurity STDOUT Logging
- GeoIP databases in ingress-nginx without maxmind GeoIP2 HOT 1
- macos 环境下编译错误 HOT 1
- Audtilog not works with nginx default-backend
- expirevar not working HOT 6
- Print ModSecurity version from nginx connector HOT 4
- CI workflow on Windows is missing HOT 1
- size of the LMDB database file does not change HOT 2
- No new version of the nginx connector has been cut in a long time(2 years) HOT 1
- Compilation issue with gcc14 and nginx 1.27.0 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from modsecurity-nginx.