yko / ngx_mod_psgi Goto Github PK
View Code? Open in Web Editor NEWnginx PSGI module
nginx PSGI module
I suggest final configuration format similar to http_upstream_module config:
http://wiki.nginx.org/HttpUpstreamModule
psgi_app my_app {
app /var/www/myapp/script/myapp.psgi;
max_requests 1000;
psgi_version 1.1;
# more options
}
server {
location / {
psgi_app my_app;
# more options
}
}
# wow! github know how to highlight nginx.conf!
Any problems here?
Hi. Recently I was looking into your module and have couple of suggestions that may help a bit in the future (or not).
Actually, I'm more interested in merging your module with my distribution than anything else. I think it would benefit everyone.
So it would be nice to have everything restructured and put together into a single file so we can merge. As time permits of course. We can discuss this privately.
And other thing. I've noticed you aren't using internal variables for PSGI ENV. It can help a bit to make things less complex and less dependent on internals in the future. Basically you can just map every internal variable into PSGI ENV.
Here's a simple example on using variables (you probably can take it out of nginx.xs, but just in case; and don't take it as something important, it isn't):
HV *hv;
ngx_str_t var;
ngx_http_variable_value_t *vv;
ngx_uint_t hash;
...
hv = newHV (); /* PSGI ENV */
...
hash = ngx_hash_key ((u_char *) "scheme", sizeof ("scheme") - 1);
var.len = sizeof ("scheme") - 1;
var.data = (u_char *) "scheme";
vv = ngx_http_get_variable(r, &var, hash);
if (vv != NULL && !vv->not_found) {
hv_store (hv, "psgi.url_scheme", sizeof("psgi.url_scheme") - 1,
newSVpvn ((char *) vv->data, vv->len), 0);
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.