Pass path to thttpd for CGI

I sort of have this working but not quite. I have
http://mysite.com/music/play/song.mp3 and this plays fine in the browser
by accessing the mp3 file in its folder. However, I want to handle
requests to download the song at
http://mysite.com/music/download/song.mp3 with a CGI script that has no
extension (it’s C). I can get /music/download to be handled by CGI in
thttpd but I don’t know how to handle the changing song titles cause
everything I’ve tried fails.

location /music {
try_files $uri.html $uri/index.html @music;
}

location @music {
proxy_pass http://127.0.0.1:8000;
}

In thttpd.conf I have:
host=127.0.0.1
port=8000
dir=/www/cgi-bin
cgipat=/**

And inside the cgi-bin is a standalone program called “download” so
/music/download returns a web page generated by that executable just to
test this. I’ve tried so many variations including rewrite that I’ve
gotten myself pretty turned around as to what I should be doing.

On Sat, Mar 22, 2014 at 05:18:19PM -0400, Doc wrote:

Hi there,

I can get /music/download to be handled by CGI in
thttpd but I don’t know how to handle the changing song titles cause
everything I’ve tried fails.

I don’t see any nginx problems here.

Can you request the download of thttpd directly? If you can’t, nginx
can’t.

If you can, post the curl command you use to get it, and you may have
better luck here.

Good luck with it,

f

Francis D. [email protected]

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs