Forum

Migrate a Apache rewrite rule for Hiawatha+Ceph's S3 fastcgi server

Richard Chan
16 November 2014, 00:58
Is there a way to pass environment variables to a FastCGI Server extracted from the HTTP method?

I have the following Apache rewrite rule that I would like to migrate

RewriteRule ^/(.*) /s3gw.fcgi?%{QUERY_STRING} [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]

This FastCGI server is Ceph's S3 gateway to the Ceph Storage Cluster.
It needs the envrionment variable to behave like Amazon AWS S3.

The url /s3gw.fcgi is a virtual path (FastCGIExternalServer) that references the socket.
It is not a real script.

All methods including PUT/DELETE need to be rewritten this way


Hiawatha version: 9.8
Operating System: CentOS 7
Hugo Leisink
16 November 2014, 20:32
All HTTP headers, except the Authorization header, are set as CGI environment variables (this also includes FastCGI). Version 9.9 will include an option (HTTPAuthToCGI) which make Hiawatha also set the Authorization HTTP header as a CGI environment variable.

About the PUT/DELETE filter, look at the Method UrlToolkit option.
Richard Chan
17 November 2014, 00:35
Thanks! Looks like 9.9 might be able to do it.
Re: method option in URL Toolkit
Can I confirm you are referring to the 9.7 changelog about the method option in url
toolkit and the documentation at https://www.hiawatha-webserver.org/manpages/hiawatha
hasn't caught up? (I did a search on that page but couldn't find it)
Hugo Leisink
17 November 2014, 14:58
Online manpage has been updated.
This topic has been closed.