Git Product home page Git Product logo

ngx_mod_psgi's People

Contributors

jraspass avatar yko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ngx_mod_psgi's Issues

nginx.conf format

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?

little bit of refactoring and thoughts about the future

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);
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.