Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sending arbitrary AJP request attributes (eg environment variables) #13

Open
davidjb opened this issue Jul 15, 2013 · 1 comment
Open

Comments

@davidjb
Copy link
Contributor

davidjb commented Jul 15, 2013

Is it currently possible to send arbitrary request attributes via this module? In particular, I'm curious as to whether it is possible to set environment variables in this fashion. For example, for mod_proxy_ajp for Apache, environment variables prefixed with AJP_ see this prefix stripped and are sent through as AJP request attributes (see https://httpd.apache.org/docs/2.2/mod/mod_proxy_ajp.html#env). I'm curious as to how this can be done with Nginx as an auth module for Apache that I'm atttempting to replicate in Nginx relies on working in this fashion.

From http://tomcat.apache.org/connectors-doc/ajp/ajpv13a.html:

Beyond this list of basic attributes, any number of other attributes can be sent via the req_attribute code (0x0A). A pair of strings to represent the attribute name and value are sent immediately after each instance of that code. Environment values are passed in via this method.

Thoughts?

@davidjb
Copy link
Contributor Author

davidjb commented Jul 15, 2013

I see that the remote port info is being sent via a request attribute: https://github.com/yaoweibin/nginx_ajp_module/blob/master/ngx_http_ajp.c#L558

So to add this feature, it would just be a case of adding another configuration option (eg ajp_set_req_attribute); allowing it to be configured like something such as proxy_set_header (http://wiki.nginx.org/NginxHttpProxyModule#proxy_set_header); and then sending these in the AJP message.

Is this something that could be added?

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant