Golang fcgi & Request exceeded the limit of 10 internal redirects

I’m trying to deploy a FCGI app, written in golang. The app appears to run fine in standalone server mode, but I get this error when trying to use it. This is on DreamHost shared hosting (fencing), set to PHP5.6 no FCGI; have also tried PHP5.6+FCGI

Log message:
[Sat Sep 05 19:47:56 2015] [error] [client] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use ‘LimitInternalRecursion’ to increase the limit if necessary. Use ‘LogLevel debug’ to get a backtrace.

Files that exist:

$ pwd
[fencing]$ ls -al
drwxrwxr-x 7 ######### 4096 Sep 5 19:55 .
drwx–x— 17 adm 4096 Sep 5 19:11 …
-rw-rw-r-- 1 ######### 282 Sep 5 19:49 .htaccess
-rwxr-xr-x 1 ######### 8376032 Sep 5 19:20 masterserver.fcgi

.htaccess contents:

<IfModule mod_fcgid.c>
AddHandler fcgid-script .fcgi

Options +ExecCGI

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ masterserver.fcgi [QSA,L]
ErrorDocument 500 "Application failed to start properly"

What I’d like to do is send all requests, e.g. GET http://subdomain.example.org/testServer to masterserver.fcgi. I’ve looked at http://wiki.dreamhost.com/FastCGI and http://www.dav-muz.net/blog/2013/09/how-to-use-go-and-fastcgi/ , but none are giving me the clues as to how to proceed. Thanks.

Since the question is 4 years old I assume the OP figured it out or gave up, but I thought I’d post in case it helped them or someone else.

I had this issue today with an fcgi Go app. What solved it for me was either of 2 things:

  1. I had Passenger enabled on my domain. This normally wants your public files to be in ~/<domain>/public. I was able to get my Go app working simply by moving my files to public (including .htaccess).

  2. I was able to get it working with the files in ~/<domain> directory by disabling Passenger and changing the “web directory” setting from ~/<domain>/public to ~/<domain>. I believe the /public was added when I enabled Passenger previously.

My .htaccess is:

DirectoryIndex myapp.fcgi
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d [OR]
RewriteCond %{REQUEST_URI} ^/$
RewriteRule ^(.*)$ myapp.fcgi/$1 [QSA,L]