# Server is unreachable when uploading wide images

**URL:** <https://forum.ghost.org/t/server-is-unreachable-when-uploading-wide-images/35590>\
**Category:** Self-hosting\
**Created:** [January 16, 2023, 6:57am UTC](https://forum.ghost.org/t/server-is-unreachable-when-uploading-wide-images/35590 "2023-01-16T06:57:55Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![KKhaoSZ](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/kkhaosz/32/22425_2.png) [@KKhaoSZ](https://forum.ghost.org/u/KKhaoSZ)\
**Post date:** [January 16, 2023, 6:57am UTC](https://forum.ghost.org/t/server-is-unreachable-when-uploading-wide-images/35590/1 "2023-01-16T06:57:55Z")

</div>

Whenever I try to upload an image, at least when the image is wide, it would say that the server is unreachable. Is there a way to increase the image upload size?

---

<div class="post-metadata">

**Author:** ![deepvyas](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/deepvyas/32/19473_2.png) [@deepvyas](https://forum.ghost.org/u/deepvyas)\
**Post date:** [January 16, 2023, 9:42am UTC](https://forum.ghost.org/t/server-is-unreachable-when-uploading-wide-images/35590/2 "2023-01-16T09:42:09Z")

</div>

Better contact your hosting support, how to resolve that issue.

---

<div class="post-metadata">

**Author:** ![markstos](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/markstos/32/18182_2.png) [@markstos](https://forum.ghost.org/u/markstos)\
**Post date:** [January 16, 2023, 12:04pm UTC](https://forum.ghost.org/t/server-is-unreachable-when-uploading-wide-images/35590/3 "2023-01-16T12:04:40Z")

</div>

What’s the exact file size of an image that fails?

On your server, use a tool like `htop` to monitor the CPU while the uploading happening. Does the server really get so busy it can’t respond?

Check your Nginx error logs (or other web server logs) for the request. What HTTP error code was logged? 500 or something else?

---

<div class="post-metadata">

**Author:** ![KKhaoSZ](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/kkhaosz/32/22425_2.png) [@KKhaoSZ](https://forum.ghost.org/u/KKhaoSZ)\
**Post date:** [January 16, 2023, 1:06pm UTC](https://forum.ghost.org/t/server-is-unreachable-when-uploading-wide-images/35590/4 "2023-01-16T13:06:57Z")

</div>

I dont think its the server because it contacts the Ghost API locally. That is why I was wondering if there is some sort of limit.

My Ghost installation is through docker.

---

<div class="post-metadata">

**Author:** ![markstos](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/markstos/32/18182_2.png) [@markstos](https://forum.ghost.org/u/markstos)\
**Post date:** [January 16, 2023, 1:08pm UTC](https://forum.ghost.org/t/server-is-unreachable-when-uploading-wide-images/35590/5 "2023-01-16T13:08:58Z")

</div>

To help you further, it’s useful to know the exact file size of the image that failed and the HTTP error code returned by your web server. Thanks. Are you using Nginx?

Pasting your web server config could also be helpful.

And since you mentioned the width of the image, what’s a file size and width that succeeds vs a file size and width that fails?

---

<div class="post-metadata">

**Author:** ![KKhaoSZ](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/kkhaosz/32/22425_2.png) [@KKhaoSZ](https://forum.ghost.org/u/KKhaoSZ)\
**Post date:** [January 16, 2023, 10:23pm UTC](https://forum.ghost.org/t/server-is-unreachable-when-uploading-wide-images/35590/6 "2023-01-16T22:23:37Z")

</div>

I got this in the inspect console:

Uncaught TypeError: Cannot read properties of undefined (reading ‘url’)  
at vendor-fadbf85ad92c591dc4bd3755312b6ddf.js:12192:55  
at e.value (vendor-fadbf85ad92c591dc4bd3755312b6ddf.js:5971:7)  
at E.updateSrc (vendor-fadbf85ad92c591dc4bd3755312b6ddf.js:12192:13)  
at B.\_join (vendor-fadbf85ad92c591dc4bd3755312b6ddf.js:3658:275)  
at B.join (vendor-fadbf85ad92c591dc4bd3755312b6ddf.js:3624:13)  
at c (vendor-fadbf85ad92c591dc4bd3755312b6ddf.js:2431:23)  
at vendor-fadbf85ad92c591dc4bd3755312b6ddf.js:802:75  
at a (vendor-fadbf85ad92c591dc4bd3755312b6ddf.js:2352:139)  
at vendor-fadbf85ad92c591dc4bd3755312b6ddf.js:802:30  
at e.onComplete (vendor-fadbf85ad92c591dc4bd3755312b6ddf.js:952:77)

The wide picture is 1902 x 505\>  
A picture that works is 1000 x 1000, but not 1200 x 1200.

I tried rescaling the wide image down to 600 x 277, but it still does not work.

---

<div class="post-metadata">

**Author:** ![markstos](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/markstos/32/18182_2.png) [@markstos](https://forum.ghost.org/u/markstos)\
**Post date:** [January 17, 2023, 2:19am UTC](https://forum.ghost.org/t/server-is-unreachable-when-uploading-wide-images/35590/7 "2023-01-17T02:19:45Z")

</div>

You may be running into your web servers max file upload size, but you haven’t confirmed which web server you are using, nor confirmed the HTTP response code issued by the server nor pasted your web server configuration.

Without knowing more details about your environment, it’s difficult to be of much more help.

When Ghost is installed through the CLI, it sets up a reasonable max file upload size for Nginx, but you said you are using Docker, so unless you tuned Nginx yourself, you are probably getting Nginx’s default value for `client_max_body_size`, which is only one megabyte.

That is size is so small that’s quite possible that a small photo would be small enough to work while a “wide” photo would have a large enough file size to trip the limit.

But you didn’t provide the file sizes, so it’s hard to know for sure.

[https://nginx.org/en/docs/http/ngx\_http\_core\_module.html#client\_max\_body\_size](https://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size)

> **[How to resolve image upload issues in Ghost](https://ghost.org/docs/faq/image-upload-issues/)**
>
> Find out how to resolve image upload errors if you're a developer maintaining a self-hosted instance of Ghost.

---

<div class="post-metadata">

**Author:** ![KKhaoSZ](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/kkhaosz/32/22425_2.png) [@KKhaoSZ](https://forum.ghost.org/u/KKhaoSZ)\
**Post date:** [January 17, 2023, 2:45am UTC](https://forum.ghost.org/t/server-is-unreachable-when-uploading-wide-images/35590/8 "2023-01-17T02:45:00Z")

</div>

All of the files are are less than 1MB. The wide image is 116KB while the square image is 141 KB.

There arent any errors from the container itself as far as I am aware.

The entire setup is isolated in a container. This is the docker-compose file that I used:

```auto
version: '3.2'

services:

  ghost:
    image: ghost:latest
    container_name: ghost
    restart: always
    ports:
      - 8080:2368

    volumes:
      - /root/vol/backup/web:/var/lib/ghost/content

    environment:
      # see https://ghost.org/docs/config/#configuration-options

      

      database__client: mysql
      database __connection__ host: db
      database __connection__ user: root
      database __connection__ password: pass
      database __connection__ database: ghost

      NODE_ENV: production

      
      # this url value is just an example, and is likely wrong for your environment!
      url: http://website.org
      # contrary to the default mentioned in the linked documentation, this image defaults to NODE_ENV=production (so development mode needs to be explicitly specified if desired)
      #NODE_ENV: development
      
  db:
    image: mysql:8.0
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: password
    volumes:
      - type: bind
        source: /root/vol/backup/config.production.json
        target: /var/lib/ghost/config.production.json

```

All of this is hosted on a VPS server on Ubuntu. I am using a reverse proxy with Nginx Proxy Manager and I have Websockets, Block Common Exploits, Force SSL, HTTP/2 Support, HSTS Enabled, HSTS Subdomains enabled. I have a Let’s Encrypt SSL certificate on my domain.

---

<div class="post-metadata">

**Author:** ![markstos](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/markstos/32/18182_2.png) [@markstos](https://forum.ghost.org/u/markstos)\
**Post date:** [January 17, 2023, 2:11pm UTC](https://forum.ghost.org/t/server-is-unreachable-when-uploading-wide-images/35590/9 "2023-01-17T14:11:04Z")

</div>

You need to look at your Nginx access logs to see the HTTP response code returned when the image fails to upload.
