# Unix:/var/discourse/shared/standalone/nginx.http.sock (2: No such file or directory) \[SOLVED\]

**URL:** <https://meta.discourse.org/t/unix-var-discourse-shared-standalone-nginx-http-sock-2-no-such-file-or-directory-solved/142342>\
**Category:** Self-hosting\
**Created:** [22 februari 2020 om 12:40 UTC](https://meta.discourse.org/t/unix-var-discourse-shared-standalone-nginx-http-sock-2-no-such-file-or-directory-solved/142342 "2020-02-22T12:40:30Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![pr0cesor](https://avatars.discourse-cdn.com/v4/letter/p/977dab/32.png) [@pr0cesor](https://meta.discourse.org/u/pr0cesor)\
**Post date:** [22 februari 2020 om 12:40 UTC](https://meta.discourse.org/t/unix-var-discourse-shared-standalone-nginx-http-sock-2-no-such-file-or-directory-solved/142342/1 "2020-02-22T12:40:30Z")

</div>

Hi everyone,

I got a 502 Bad Gateway on my website and I can’t get pass this issue with nginx.http.sock

Nginx error.log

> `[crit] 14339#14339: *1 connect() to unix:/var/discourse/shared/standalone/nginx.http.sock failed (2: No such file or directory) while connecting to upstream, client: **.***. ***.*** , server: mydomain.net, request: "GET / HTTP/2.0", upstream: "http://unix:/var/discourse/shared/standalone/nginx.http.sock:/", host: "mydomain.net", referrer: "https:/mydomain.net/" "`

Below my discourse.conf

> ```
> server {
> listen 80;
> listen [::]:80;
> server_name mydmain.net www.mydomain.net; # <-- change this
> 
> }
> 
> server {
> listen 443 ssl http2;
> listen [::]:443 ssl http2;
> server_name mydomain www.mydomain.net; # <-- change this
> 
> ssl on;
> ssl_certificate /etc/letsencrypt/live/mydomain.net/fullchain.pem; # managed by Certbot
> ssl_certificate_key /etc/letsencrypt/live/mydomain.net/privkey.pem; # managed by Certbot
> ssl_dhparam /etc/letsencrypt/live/mydomain.net/dhparams.pem;
> include /etc/nginx/snippets/ssl.conf;
> 
> http2_idle_timeout 5m; # up from 3m default
> 
> location / {
> proxy_pass http://unix:/var/discourse/shared/standalone/nginx.http.sock;
> proxy_set_header Host $http_host;
> proxy_http_version 1.1;
> proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
> proxy_set_header X-Forwarded-Proto https;
> proxy_set_header X-Real-IP $remote_addr;
> 
> }
> }
> 
> ```

My app.yml

> ```
> templates:
> - "templates/postgres.template.yml"
> - "templates/redis.template.yml"
> - "templates/web.template.yml"
> - "templates/sshd.template.yml"
> - "templates/web.ratelimited.template.yml"
> ## Uncomment these two lines if you wish to add Lets Encrypt (https)
> - "templates/web.ssl.template.yml"
> - "templates/web.letsencrypt.ssl.template.yml"
> ## - "templates/web.socketed.template.yml"
> ## which TCP/IP ports should this container expose?
> ## If you want Discourse to share a port with another webserver like Apache or nginx,
> ## see https://meta.discourse.org/t/17247 for details
> #expose:
> # - "2045:80" # http
> # - "1443:443" # https
> 
> ```

I tried to uncomment “templates/web.socketed.template.yml” as well but same result in the Nginx error log. What should I do to solve this problem? I ran out of idea. Please help ;/

---

_[View the full topic](https://meta.discourse.org/t/unix-var-discourse-shared-standalone-nginx-http-sock-2-no-such-file-or-directory-solved/142342)._
