# Discourse smesso di funzionare con errori 404

**URL:** https://meta.discourse.org/t/discourse-stopped-working-with-404-errors/106997
**Category:** Self-hosting
**Created:** [20 Gennaio 2019, 12:56am UTC](https://meta.discourse.org/t/discourse-stopped-working-with-404-errors/106997 "2019-01-20T00:56:27Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Bruce\_Bates](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bruce_bates/32/122887_2.png) [@Bruce\_Bates](https://meta.discourse.org/u/Bruce_Bates)
#### Post date: [20 Gennaio 2019, 12:56am UTC](https://meta.discourse.org/t/discourse-stopped-working-with-404-errors/106997/1 "2019-01-20T00:56:27Z")

</div>

Discourse was working great for a few months, then I wake up to find the page won’t load. Not sure if something changed in my system’s config or what. I tried `sudo ./launcher rebuild app` that didn’t seem to help. Then I tried `sudo ./discourse-setup` again, that got the site to at least load.

The problem is its loading a blank white page. When I check the inspector it returns pretty much all js files as 502 gateway errors. If I load the site on http instead of https, the errors are all 404 instead of 502.

I did a `sudo ./laucher enter app` and verified all the files exist - and they do, so I am at a complete loss. I was thinking perhaps an error in my nginx front end configuration, but I see nothing out of the ordinary.

Is there something I have forgotten or am I doing something incorrectly in my config or what could be going on?

**my nginx.conf**

```
server {
  listen my.ip.address:80;
  server_name mydomain.name;
  error_log /var/log/mydomain.name.error.log error;

  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-Proto https;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

    proxy_cache cache;
    proxy_cache_valid 15m;
    proxy_cache_valid 404 1m;
    proxy_no_cache $no_cache;
    proxy_cache_bypass $no_cache;
    proxy_cache_bypass $cookie_session $http_x_update;

    location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|tif|tiff|css|js|htm|html|ttf|otf|webp|woff|txt|csv|rtf|doc|docx|xls|xlsx|ppt|pptx|odf|odp|ods|odt|pdf|psd|ai|eot|eps|ps|zip|tar|tgz|gz|rar|bz2|7z|aac|m4a|mp3|mp4|ogg|wav|wma|3gp|avi|flv|m4v|mkv|mov|mpeg|mpg|wmv|exe|iso|dmg|swf)$ {
      root /path/to/mydomain.name/public_html;
      access_log /var/log/mydomain.name.log combined;
      access_log /var/log/mydomain.name.bytes bytes;
      expires max;
      try_files $uri @fallback;
    }
  }
.....

```

**My nginx.ssl.conf**

```
server {
  listen my.ip.address:443;
  server_name mydomain.name;
  ssl on;
  ssl_certificate /path/to/ssl.mydomain.name.pem;
  ssl_certificate_key /path/to/ssl.mydomain.name.key;
  error_log /var/log/mydomain.name.error.log error;

  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-Proto https;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

    proxy_cache cache;
    proxy_cache_valid 15m;
    proxy_cache_valid 404 1m;
    proxy_no_cache $no_cache;
    proxy_cache_bypass $no_cache;
    proxy_cache_bypass $cookie_session $http_x_update;

    location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|tif|tiff|css|js|htm|html|ttf|otf|webp|woff|txt|csv|rtf|doc|docx|xls|xlsx|ppt|pptx|odf|odp|ods|odt|pdf|psd|ai|eot|eps|ps|zip|tar|tgz|gz|rar|bz2|7z|aac|m4a|mp3|mp4|ogg|wav|wma|3gp|avi|flv|m4v|mkv|mov|mpeg|mpg|wmv|exe|iso|dmg|swf)$ {
      root /path/to/mydomain.name/public_html;
      access_log /var/log/mydomain.name.log combined;
      access_log /var/log/mydomain.name.bytes bytes;
      expires max;
      try_files $uri @fallback;
    }
  }
....

```

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [20 Gennaio 2019, 2:52pm UTC](https://meta.discourse.org/t/discourse-stopped-working-with-404-errors/106997/2 "2019-01-20T14:52:13Z")

</div>

Are you out of disk space?

Try

```
 ./discourse-doctor

```

---

<div class="post-metadata">

### Author: ![Bruce\_Bates](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bruce_bates/32/122887_2.png) [@Bruce\_Bates](https://meta.discourse.org/u/Bruce_Bates)
#### Post date: [20 Gennaio 2019, 4:27pm UTC](https://meta.discourse.org/t/discourse-stopped-working-with-404-errors/106997/3 "2019-01-20T16:27:48Z")

</div>

100% not out of space:

 ![space](https://global.discourse-cdn.com/meta/original/3X/4/6/468e81e8cc259a4ec3515514bbc02b76a6129f6f.png)

discourse doctor reports:

```
========================================
Discourse 2.2.0.beta8
Discourse version at domain.name: Discourse 2.2.0.beta8
Discourse version at localhost: NOT FOUND
==================== DNS PROBLEM ====================
This server reports NOT FOUND, but domain.name reports Discourse 2.2.0.beta8 .
This suggests that you have a DNS problem or that an intermediate proxy is to blame.
If you are using Cloudflare, or a CDN, it may be improperly configured.

```

This is why I was thinking some sort of issue with the nginx config. I am not using cloudflare or any CDN, which only leave the nginx front end config.

All DNS checking tools I haev tried say my DNS config is fine.

 ![dns](https://global.discourse-cdn.com/meta/original/3X/a/2/a2721c6b6b13f32b8fd1dc7fce53a695d5495761.png)

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [20 Gennaio 2019, 6:46pm UTC](https://meta.discourse.org/t/discourse-stopped-working-with-404-errors/106997/4 "2019-01-20T18:46:26Z")

</div>

Ah. No. Discourse-doctor doesn’t know about your reverse proxy so that’s a red herring. Sorry. That’s no help.

Is the server overloaded? Recent update causes images to be reprocessed.

---

<div class="post-metadata">

### Author: ![Bruce\_Bates](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bruce_bates/32/122887_2.png) [@Bruce\_Bates](https://meta.discourse.org/u/Bruce_Bates)
#### Post date: [20 Gennaio 2019, 6:59pm UTC](https://meta.discourse.org/t/discourse-stopped-working-with-404-errors/106997/5 "2019-01-20T18:59:39Z")

</div>

Not as far as I can see, load averages are low, bandwidth usage is low, memory usage is low, nginx usage is low - nothing unusual from what I can see.

---

<div class="post-metadata">

### Author: ![Bruce\_Bates](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bruce_bates/32/122887_2.png) [@Bruce\_Bates](https://meta.discourse.org/u/Bruce_Bates)
#### Post date: [21 Gennaio 2019, 4:11am UTC](https://meta.discourse.org/t/discourse-stopped-working-with-404-errors/106997/6 "2019-01-21T04:11:10Z")

</div>

Consider this problem sorted.

Apparently the control panel I use to manage my server has a bunch of different nginx setups, and I had somehow managed to switching it from a default proxy nginx configuration to a caching nginx configuration.

The minute I switched it back to a default proxy config, everything started working again. Only 3 days wasted trying to sort this and in the end it was completely unrelated to the server{} directives of nginx.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [15 Gennaio 2022, 7:52am UTC](https://meta.discourse.org/t/discourse-stopped-working-with-404-errors/106997/7 "2022-01-15T07:52:00Z")

</div>



---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [17 Gennaio 2022, 5:57pm UTC](https://meta.discourse.org/t/discourse-stopped-working-with-404-errors/106997/8 "2022-01-17T17:57:42Z")

</div>


