Comments (2)
Hi @vigie,
Unfortunately it is not possible to make a subrequest to a named location due to limitation of the nginx internal API. But you can make a subrequest to an internal location which is protected from the outside. Please, take a look: http://nginx.org/en/docs/http/ngx_http_core_module.html#internal
for example:
var my_body = process(req.body);
req.subrequest('/internal', {body:my_body},
function(reply) {res.return(reply.status == 200 ? 200 : 500)})
from njs.
This is exactly what I was looking for, internal
had escaped me somehow.
Thanks very much for the quick help @xeioex
from njs.
Related Issues (20)
- First chunk detection in js_body_filter HOT 1
- how to hide response header : server HOT 3
- How to log to a separate log file instead of error log file? HOT 2
- Detached r.subrequest not running HOT 4
- ngx.shared.SharedDict.clear() fails! HOT 2
- Shared library and installation
- js_periodic / Reading status connections growing HOT 3
- ngx.fetch Content-Length header is not sent HOT 8
- How to implement an external rate limitter? HOT 2
- njs_string_atob cannot handle cypertext unless the padding is intact HOT 1
- Add Support for js_balancer like balancer_by_lua_block HOT 2
- How to remove or override value of 'Server' header for all locations. HOT 10
- Introducing QuickJS engine as alternative JS engine. HOT 7
- ngx.shared.SharedDict.clear() hangs when called on an empty dict HOT 1
- NJS call wrong function. HOT 7
- Sending a Buffer with r.send() does not work HOT 1
- Repo looks empty
- Test failure with zlib-ng HOT 6
- False Positive Duplicate Checker Warning HOT 3
- njs source code compile error 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 njs.