Hello!
On Fri, Aug 15, 2014 at 2:01 PM, rohit.c.joshi wrote:
> OSB Layer features we are using and need to replace with OpenResty:
>
> * Two way SSL connections (upstream and downstream). This is due to security
> requirements. Downstream (Clients) SSL certificates are different than
> upstream (toward app server)
Nginx already supports this out of the box. Also, ngx_lua has Lua-land
SSL cosocket suppport just recently :)
> Rewrites URL
Trivial for the nginx world :)
> Api Key validation against database
What kind of database you're accessing? Hopefully it is not something
using proprietary wire protocol like the Oracle database.
> Creating a custom RequestId header (for end to end debugging)
>
Trivial for the ngx_lua or ngx_headers_more modules.
> I am looking at possibly using OpenResty as a replacement to Oracle Service
> Bus as OSB is very heavy and we are not using any OSB related features.
>
Sounds cool :)
> 3. I am able to rewrite URL for upstream servers using following config.
> This will be replaced by lua script later.
> location /foo/
> {
> rewrite ^/foo/(.*) /bar/$1/ break;
> proxy_pass
https://upstream:8230;
> }
>
You can also configure upstream SSL certificates (and etc) via the
proxy_ssl_trusted_certificate directive. Check out the official
documentation of ngx_proxy:
http://nginx.org/en/docs/http/ngx_http_proxy_module.html
> 4. I am working on
> a. integrating postgres module to validate the Api-Key which is coming
> as part of http header
Okay, you can use the ngx_postgres module with ngx_lua's
ngx.locaton.capture() + lua-resty-rds to access Pg or just choose from
those 3rd-party Lua libraries talking to Pg directly via ngx_lua's
cosocket API.
> b. populating required id into upstream http header
>
You can use the proxy_set_header directive provided by ngx_proxy for
it. Or just use ngx_lua's Lua API function ngx.req.set_header().
> I need help configuring upstream two way SSL connection. Any help would be
> appreciated.
>
See above.
Regards,
-agentzh