# 502 Bad Gateway - nginx/1.14.0 (Ubuntu): Unable to find image locally + Error response from daemon

**URL:** <https://meta.discourse.org/t/502-bad-gateway-nginx-1-14-0-ubuntu-unable-to-find-image-locally-error-response-from-daemon/133392>\
**Category:** Self-hosting\
**Created:** [November 14, 2019, 1:48pm UTC](https://meta.discourse.org/t/502-bad-gateway-nginx-1-14-0-ubuntu-unable-to-find-image-locally-error-response-from-daemon/133392 "2019-11-14T13:48:41Z")\
**Posts on this page:** 1\
**Showing post:** 14

<div class="post-metadata">

**Author:** ![naupe](https://avatars.discourse-cdn.com/v4/letter/n/eb8c5e/32.png) [@naupe](https://meta.discourse.org/u/naupe)\
**Post date:** [November 18, 2019, 2:53am UTC](https://meta.discourse.org/t/502-bad-gateway-nginx-1-14-0-ubuntu-unable-to-find-image-locally-error-response-from-daemon/133392/14 "2019-11-18T02:53:35Z")

</div>

I resolved my issue! My Discourse Forum shows up now in a Browser!

Well, to be more specific, [Francis Day over on the Nginx Forums resolved my issue!](https://forum.nginx.org/read.php?2,286226,286227#msg-286227) It was indeed Nginx all along. Here is what I did:

1. Logged into my Nginx VM.
2. VIMed Discourse CONF file: `vim /etc/nginx/sites-available/discourse.conf`
3. [Here is what my Discourse CONF file looked like](https://pastebin.com/fiiyATeP) (obviously not using the Domain Name I would normally use, and where **192.168.0.101 = Nginx VM** and **192.168.0.104 = Discourse VM** ).
4. I only made one change: I changed `proxy_pass http://discourse.domainame.com:8080/;` to `proxy_pass 192.168.0.104:8080/;`. So [proxy\_pass](http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_pass) is set to the Discourse VM’s **Local IP** _instead of_ the **Hostname**.
5. Save the CONF file, and then Reloaded (`systemctl reload nginx.service`) and Restarted (`systemctl restart nginx.service`) Nginx.
6. Viola! I refresh the Discourse URL, and it comes up! Didn’t even need to Restart/Rebuild Discourse!

I hope someone finds what I’ve written here useful, as reverse proxying Discourse through Nginx can be really tricky.

---

_[View the full topic](https://meta.discourse.org/t/502-bad-gateway-nginx-1-14-0-ubuntu-unable-to-find-image-locally-error-response-from-daemon/133392)._
