# Mono + nginx (OpenBSD 5.3)

**URL:** <https://www.ruby-forum.com/t/mono-nginx-openbsd-5-3/228749>\
**Category:** NGINX\
**Created:** [May 6, 2013, 7:55pm UTC](https://www.ruby-forum.com/t/mono-nginx-openbsd-5-3/228749 "2013-05-06T19:55:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/47e85d/32.png) [@Gee](https://www.ruby-forum.com/u/Gee)\
**Post date:** [May 6, 2013, 7:55pm UTC](https://www.ruby-forum.com/t/mono-nginx-openbsd-5-3/228749/1 "2013-05-06T19:55:08Z")

</div>

Hi

I am having trouble getting Mono to work with nginx. I installed my OS  
(OpenBSD 5.3) and set up ports. I built mono, mono-xsp and nginx - all  
without incident. All three appear to be working OK, but not in  
conjunction.

I am trying to run the default MVC3 web app, but keep getting a 502 (Bad  
gateway). In the log, I see the following:

[crit] 31764#0: \*1 connect() to unix:/tmp/fastcgi.socket failed (2: No  
such  
file or directory) while connecting to upstream,

The frustrating thing here is that /tmp/fastcgi.socket does actually  
exist.  
I tried ‘touch’ and making sure ‘wheel’ has the appropriate  
permissions.  
The result of ‘ls -la /tmp/fastcgi.socket’ revealed nothing awry.

Does anyone have any ideas/hints?

To try and save time, here is my config:

worker\_processes 1;

events {  
worker\_connections 1024;  
}

http {  
include mime.types;  
default\_type application/octet-stream;

```
server {
    listen 80;
    access_log /home/www/nginx.log;
    error_log /home/www/errors.log;

    # root /home/www/test;
    # index index.html index.htm index.aspx default.aspx;

    location ^~ /Scripts/ { }
    location ^~ /Content/ { }

    location / {
        root /home/www/test;
        # fastcgi_index /Home/Index;

        fastcgi_pass unix:/tmp/fastcgi.socket;
        # include fastcgi_params;
        include /etc/nginx/fastcgi_params;
    }
}

```

}

Thanks  
G

---

<div class="post-metadata">

**Author:** ![Gee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/47e85d/32.png) [@Gee](https://www.ruby-forum.com/u/Gee)\
**Post date:** [May 6, 2013, 8:21pm UTC](https://www.ruby-forum.com/t/mono-nginx-openbsd-5-3/228749/2 "2013-05-06T20:21:26Z")

</div>

On 06/05/13 18:47, Gee wrote:

> 

see if you can connect to the unix/fcgi socket like this:  
[http://www.ralf-lang.de/2011/11/22/using-socat-to-debug-unix-sockets-like-telnet-for-tcp/](http://www.ralf-lang.de/2011/11/22/using-socat-to-debug-unix-sockets-like-telnet-for-tcp/)  
other than that.. I’m out of ideas 🙂

---

<div class="post-metadata">

**Author:** ![Gee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/47e85d/32.png) [@Gee](https://www.ruby-forum.com/u/Gee)\
**Post date:** [May 6, 2013, 8:27pm UTC](https://www.ruby-forum.com/t/mono-nginx-openbsd-5-3/228749/3 "2013-05-06T20:27:18Z")

</div>

On 6 May 2013 18:47, Gee [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> [crit] 31764#0: \*1 connect() to unix:/tmp/fastcgi.socket failed (2: No such  
> file or directory) while connecting to upstream,

I vaguely recall seeing this when running some Mono stuff behind a  
local nginx proxy. I moved off the project before seeing how people  
fixed it, but ISTR that it was a permissions issue.

As a _test_(!), chmod 777 /tmp/fastcgi.socket _and_restart_everything_.  
That’s obviously not a fix, but it’ll at least show you if you’re  
heading in the right direction.

## Jonathan

Jonathan M. // Oxford, London, UK

> **[Jonathan Matthews :: Words Typed, Great Rates For Cash](https://www.jpluscplusm.com)**
