# Otrs on nginx with fcgiwrap

**URL:** <https://www.ruby-forum.com/t/otrs-on-nginx-with-fcgiwrap/225530>\
**Category:** NGINX\
**Created:** [January 13, 2013, 4:40pm UTC](https://www.ruby-forum.com/t/otrs-on-nginx-with-fcgiwrap/225530 "2013-01-13T16:40:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@aris](https://www.ruby-forum.com/u/aris)\
**Post date:** [January 13, 2013, 4:40pm UTC](https://www.ruby-forum.com/t/otrs-on-nginx-with-fcgiwrap/225530/1 "2013-01-13T16:40:02Z")

</div>

Hi There,

I’m trying to run OTRS on Debian with nginx and fcgiwrap. But all I get  
is  
this error:

FastCGI sent in stderr: “Cannot get script name, is DOCUMENT\_ROOT and  
SCRIPT\_NAME set  
and is the script executable?” while reading response header from  
upstream,

client: 123.123.123.123,  
server: [support.example.com](http://support.example.com),  
request: “GET /otrs/index.pl HTTP/1.1”,  
upstream: “fastcgi://unix:/var/www/sockets/fcgiwrap.socket:”,  
host: “[support.example.com](http://support.example.com)”, referrer: “[http://support.examle.com/](http://support.examle.com/)”  
Here’s my configuration:

server {  
server\_name [support.example.com](http://support.example.com);

```
access_log /var/www/support/log/access.log;
access_log /var/log/nginx/access.log;
error_log /var/www/support/log/error.log info;

fastcgi_buffers 8 16k;
fastcgi_buffer_size 32k;

root /var/www/support/otrs/var/httpd/htdocs;

index index.html;

location = /favicon.ico {
        access_log off;
        log_not_found off;
}

location /otrs-web/ {
        alias /var/www/support/otrs/var/httpd/htdocs;
}

location ~ ^/otrs/(.*\.pl)(/.*)?$ {
        gzip off;

        fastcgi_pass unix:/var/www/sockets/fcgiwrap.socket;

        fastcgi_index index.pl;

        fastcgi_param SCRIPT_FILENAME

```

/var/www/support/otrs/bin/fcgi-bin/$1;

```
        include fastcgi_params;

}

```

}  
and the fastcgi\_params:

fastcgi\_connect\_timeout 65;  
fastcgi\_send\_timeout 180;  
fastcgi\_read\_timeout 180;

fastcgi\_param QUERY\_STRING $query\_string;  
fastcgi\_param REQUEST\_METHOD $request\_method;  
fastcgi\_param CONTENT\_TYPE $content\_type;  
fastcgi\_param CONTENT\_LENGTH $content\_length;

fastcgi\_param SCRIPT\_FILENAME $request\_filename;  
fastcgi\_param SCRIPT\_NAME $fastcgi\_script\_name;  
fastcgi\_param REQUEST\_URI $request\_uri;  
fastcgi\_param DOCUMENT\_URI $document\_uri;  
fastcgi\_param DOCUMENT\_ROOT $document\_root;  
fastcgi\_param SERVER\_PROTOCOL $server\_protocol;

fastcgi\_param GATEWAY\_INTERFACE CGI/1.1;  
fastcgi\_param SERVER\_SOFTWARE nginx/$nginx\_version;

fastcgi\_param REMOTE\_ADDR $remote\_addr;  
fastcgi\_param REMOTE\_PORT $remote\_port;  
fastcgi\_param SERVER\_ADDR $server\_addr;  
fastcgi\_param SERVER\_PORT $server\_port;  
fastcgi\_param SERVER\_NAME $server\_name;

fastcgi\_param HTTPS $https;

# PHP only, required if PHP was built with --enable-force-cgi-redirect

fastcgi\_param REDIRECT\_STATUS 200;

Any idea what could be the problem?

Kind regards  
Pascal

Posted at Nginx Forum:

> **[otrs on nginx with fcgiwrap](https://forum.nginx.org/read.php?2,235011,235011#msg-235011)**
>
> Hi There, I'm trying to run OTRS on Debian with nginx and fcgiwrap. But all I get is this error: FastCGI sent in stderr: "Cannot get script name, is DOCUMENT\_ROOT and SCRIPT\_NAME set and is the script executable?" while reading response...

---

<div class="post-metadata">

**Author:** ![pascalturbo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/b2d939/32.png) [@pascalturbo](https://www.ruby-forum.com/u/pascalturbo)\
**Post date:** [January 13, 2013, 10:52pm UTC](https://www.ruby-forum.com/t/otrs-on-nginx-with-fcgiwrap/225530/2 "2013-01-13T22:52:08Z")

</div>

On Sun, Jan 13, 2013 at 10:39:14AM -0500, PascalTurbo wrote:

Hi there,

> I’m trying to run OTRS on Debian with nginx and fcgiwrap. But all I get is  
> this error:
> 
> FastCGI sent in stderr: “Cannot get script name, is DOCUMENT\_ROOT and  
> SCRIPT\_NAME set  
> and is the script executable?” while reading response header from upstream,

All untested, but:

that message suggests that your fastcgi server (==fcgiwrap) uses  
DOCUMENT\_ROOT and SCRIPT\_NAME to decide which file to process.

Which file do you want fcgiwrap to process?

What is DOCUMENT\_ROOT? What is SCRIPT\_NAME? Does combining them lead  
you to that file?

Is that file executable?

It may be that switching to a fcgiwrap that uses SCRIPT\_FILENAME is the  
simplest fix for you.

Or maybe your fcgiwrap does already use SCRIPT\_FILENAME, but it uses  
the last one that it receives – in that case putting your “include”  
line before your “fastcgi\_param” line may be sufficient.

You must match your nginx “fastcgi\_param” configuration to whatever it  
is that your fastcgi server requires. Your fastcgi server documentation  
may give a better indication of what that is.

## f

Francis D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
