# Discourse site loads via IP but via domain only header

**URL:** https://meta.discourse.org/t/discourse-site-loads-via-ip-but-via-domain-only-header/104564
**Category:** Support
**Created:** [December 18, 2018, 3:14pm UTC](https://meta.discourse.org/t/discourse-site-loads-via-ip-but-via-domain-only-header/104564 "2018-12-18T15:14:23Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![guapic](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/guapic/32/127117_2.png) [@guapic](https://meta.discourse.org/u/guapic)
#### Post date: [December 18, 2018, 3:14pm UTC](https://meta.discourse.org/t/discourse-site-loads-via-ip-but-via-domain-only-header/104564/1 "2018-12-18T15:14:23Z")

</div>

Hi guys

Anyone aware of an issue that prevents a site from loading over the domain? only the Header loads. But If i try to load via the IP of the vps everything works just fine?

Thanks

---

<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: [December 18, 2018, 3:40pm UTC](https://meta.discourse.org/t/discourse-site-loads-via-ip-but-via-domain-only-header/104564/2 "2018-12-18T15:40:01Z")

</div>

Did you configure the correct domain in app.yml?

---

<div class="post-metadata">

### Author: ![guapic](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/guapic/32/127117_2.png) [@guapic](https://meta.discourse.org/u/guapic)
#### Post date: [December 18, 2018, 3:46pm UTC](https://meta.discourse.org/t/discourse-site-loads-via-ip-but-via-domain-only-header/104564/3 "2018-12-18T15:46:20Z")

</div>

Happy happy birthday! and thanks for your time

It is set correctly, any other ideas? randomly it will load the site but most of the time just the header. yet the site over IP loads perfectly. it was working fine for over 2 years now…

---

<div class="post-metadata">

### Author: ![guapic](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/guapic/32/127117_2.png) [@guapic](https://meta.discourse.org/u/guapic)
#### Post date: [December 18, 2018, 5:07pm UTC](https://meta.discourse.org/t/discourse-site-loads-via-ip-but-via-domain-only-header/104564/5 "2018-12-18T17:07:45Z")

</div>

Could it be an issue with cloudflare?

---

<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: [December 18, 2018, 6:09pm UTC](https://meta.discourse.org/t/discourse-site-loads-via-ip-but-via-domain-only-header/104564/6 "2018-12-18T18:09:57Z")

</div>

That would explain it. Best to turn off the orange cloud. Else, you will need to turn off various speed-up things until it starts working.

---

<div class="post-metadata">

### Author: ![guapic](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/guapic/32/127117_2.png) [@guapic](https://meta.discourse.org/u/guapic)
#### Post date: [December 18, 2018, 6:33pm UTC](https://meta.discourse.org/t/discourse-site-loads-via-ip-but-via-domain-only-header/104564/7 "2018-12-18T18:33:00Z")

</div>

Cloud was originally on and the site worked. Now its just loading the header only. but on IP its fine which explains a domain issue. Any ideas though? . If i turn the cloud off the site gives an insecure error

---

<div class="post-metadata">

### Author: ![guapic](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/guapic/32/127117_2.png) [@guapic](https://meta.discourse.org/u/guapic)
#### Post date: [December 18, 2018, 7:13pm UTC](https://meta.discourse.org/t/discourse-site-loads-via-ip-but-via-domain-only-header/104564/8 "2018-12-18T19:13:12Z")

</div>

Update, disabling cloudflare does not resolve the issue unfortunately.

---

<div class="post-metadata">

### Author: ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)
#### Post date: [December 18, 2018, 7:26pm UTC](https://meta.discourse.org/t/discourse-site-loads-via-ip-but-via-domain-only-header/104564/9 "2018-12-18T19:26:24Z")

</div>

> [@guapic](#):
>
> only the Header loads

Have you checked the error console in your browser for hints as to how it’s failing?

---

<div class="post-metadata">

### Author: ![guapic](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/guapic/32/127117_2.png) [@guapic](https://meta.discourse.org/u/guapic)
#### Post date: [December 18, 2018, 7:39pm UTC](https://meta.discourse.org/t/discourse-site-loads-via-ip-but-via-domain-only-header/104564/10 "2018-12-18T19:39:23Z")

</div>

Yes, there are a few errors such as this

“Uncaught ReferenceError: jQuery is not defined”

---

<div class="post-metadata">

### Author: ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)
#### Post date: [December 18, 2018, 7:43pm UTC](https://meta.discourse.org/t/discourse-site-loads-via-ip-but-via-domain-only-header/104564/11 "2018-12-18T19:43:22Z")

</div>

Could you please post ALL of the errors? By the time we get to the error you posted, there’s probably already been multiple significant errors that caused this one.

---

<div class="post-metadata">

### Author: ![guapic](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/guapic/32/127117_2.png) [@guapic](https://meta.discourse.org/u/guapic)
#### Post date: [December 18, 2018, 7:51pm UTC](https://meta.discourse.org/t/discourse-site-loads-via-ip-but-via-domain-only-header/104564/12 "2018-12-18T19:51:41Z")

</div>

Thanks for your time, exporting the error list brings up the following:

```plaintext
ember_jquery-07f49b58317ea9292d939348ec0091eb50a9d8aaabd9e86cc074ef5f049918aa.js:6 Uncaught SyntaxError: Invalid or unexpected token
_preload-store-ec90ffab9d7a6d9e507dda7cf7343e9d50b8bce624f7f44486ac8fd6b9814309.js:1 Uncaught TypeError: define is not a function
    at _preload-store-ec90ffab9d7a6d9e507dda7cf7343e9d50b8bce624f7f44486ac8fd6b9814309.js:1
vendor-957bcfd0b1422c19974dcf8f64f73eeada523e3d12dd3c76eb24c753f9399397.js:1 Uncaught ReferenceError: Ember is not defined
    at vendor-957bcfd0b1422c19974dcf8f64f73eeada523e3d12dd3c76eb24c753f9399397.js:1
    at vendor-957bcfd0b1422c19974dcf8f64f73eeada523e3d12dd3c76eb24c753f9399397.js:1
vendor-957bcfd0b1422c19974dcf8f64f73eeada523e3d12dd3c76eb24c753f9399397.js:1 Uncaught ReferenceError: $ is not defined
    at window.onerror (vendor-957bcfd0b1422c19974dcf8f64f73eeada523e3d12dd3c76eb24c753f9399397.js:1)
_pretty-text-bundle-1ffc769a242112508cf55cebf48084d3d074ec9376e7448676acd524a027b1d6.js:1 Uncaught TypeError: define is not a function
    at _pretty-text-bundle-1ffc769a242112508cf55cebf48084d3d074ec9376e7448676acd524a027b1d6.js:1
application-2d07fc19aa7165b0fc0c3b985a2b90f6cf72cc5f4420ad8626f14626e15a049e.js:8 Uncaught SyntaxError: Unexpected end of input
_plugin-e206a6cff2124b943dc0420347fa41f9e92d28b8100c0e7be64b7f5a2705bfe5.js:58 Uncaught ReferenceError: jQuery is not defined
    at _plugin-e206a6cff2124b943dc0420347fa41f9e92d28b8100c0e7be64b7f5a2705bfe5.js:58
_preload-application-data-0a59ccab480941aaac91f9e7fa7f77496323ae056aaa4158822dea35de319c01.js:2 Uncaught ReferenceError: require is not defined
    at _preload-application-data-0a59ccab480941aaac91f9e7fa7f77496323ae056aaa4158822dea35de319c01.js:2
    at _preload-application-data-0a59ccab480941aaac91f9e7fa7f77496323ae056aaa4158822dea35de319c01.js:66

```

---

<div class="post-metadata">

### Author: ![guapic](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/guapic/32/127117_2.png) [@guapic](https://meta.discourse.org/u/guapic)
#### Post date: [December 20, 2018, 9:05pm UTC](https://meta.discourse.org/t/discourse-site-loads-via-ip-but-via-domain-only-header/104564/13 "2018-12-20T21:05:33Z")

</div>

Not to bother you but did you have a chance to review this?

---

<div class="post-metadata">

### Author: ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)
#### Post date: [December 20, 2018, 9:11pm UTC](https://meta.discourse.org/t/discourse-site-loads-via-ip-but-via-domain-only-header/104564/14 "2018-12-20T21:11:49Z")

</div>

> [@guapic](#):
>
> ember\_jquery-07f49b58317ea9292d939348ec0091eb50a9d8aaabd9e86cc074ef5f049918aa.js:6 Uncaught SyntaxError: Invalid or unexpected token

Looks like this file is corrupt - if you look at the file is there anything obvious?

Have you tried rebuilding?

---

<div class="post-metadata">

### Author: ![guapic](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/guapic/32/127117_2.png) [@guapic](https://meta.discourse.org/u/guapic)
#### Post date: [December 20, 2018, 9:13pm UTC](https://meta.discourse.org/t/discourse-site-loads-via-ip-but-via-domain-only-header/104564/15 "2018-12-20T21:13:05Z")

</div>

I have tried rebuilding and updatting, same problem unfortunately

---

<div class="post-metadata">

### Author: ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)
#### Post date: [December 20, 2018, 9:32pm UTC](https://meta.discourse.org/t/discourse-site-loads-via-ip-but-via-domain-only-header/104564/16 "2018-12-20T21:32:16Z")

</div>

After looking at the `.js` file in question, I see that it’s truncated and my browser is throwing networking errors to the console.

This is probably caused by using CloudFlare - we have seen [enough problems](https://meta.discourse.org/search?q=cloudflare) using CloudFlare that we recommend disabling it entirely if possible.

This particular error seems to be on CloudFlare’s end as my browser also threw various non-source related errors downloading the file such as:

```plaintext
GET https://forum.example.com/assets/ember_jquery-07f49b58317ea9292d939348ec0091eb50a9d8aaabd9e86cc074ef5f049918aa.js net::ERR_SPDY_PROTOCOL_ERROR 200

```

And it even errored on the command line:

```plaintext
○ → wget https://forum.example.com/assets/ember_jquery-07f49b58317ea9292d939348ec0091eb50a9d8aaabd9e86cc074ef5f049918aa.js
--2018-12-20 16:30:10-- https://forum.example.com/assets/ember_jquery-07f49b58317ea9292d939348ec0091eb50a9d8aaabd9e86cc074ef5f049918aa.js
Resolving forum.example.com (forum.example.com)... 104.18.37.128, 104.18.36.128
Connecting to forum.example.com (forum.example.com)|104.18.37.128|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/javascript]
Saving to: ‘ember_jquery-07f49b58317ea9292d939348ec0091eb50a9d8aaabd9e86cc074ef5f049918aa.js’

ember_jquery-07f49b [<=>] 160.87K --.-KB/s in 0.03s   

2018-12-20 16:30:11 (4.62 MB/s) - Read error at byte 164729 (Success).Retrying.

--2018-12-20 16:30:12-- (try: 2) https://forum.example.com/assets/ember_jquery-07f49b58317ea9292d939348ec0091eb50a9d8aaabd9e86cc074ef5f049918aa.js
Connecting to forum.example.com (forum.example.com)|104.18.37.128|:443... connected.
HTTP request sent, awaiting response... 416 Requested Range Not Satisfiable

    The file is already fully retrieved; nothing to do.

```

I would recommend disabling CloudFlare entirely here if possible; if not, search meta for recommendations on disabling all of CloudFlare’s optimizations.

---

<div class="post-metadata">

### Author: ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)
#### Post date: [December 20, 2018, 9:44pm UTC](https://meta.discourse.org/t/discourse-site-loads-via-ip-but-via-domain-only-header/104564/18 "2018-12-20T21:44:29Z")

</div>

> [@guapic](#):
>
> If i turn the cloud off the site gives an insecure error

You’ll need an SSL certificate; I recommend following the [Set up HTTPS support with Let's Encrypt](https://meta.discourse.org/t/setting-up-https-support-with-lets-encrypt/40709) guide to get a free SSL certificate for your site.

First though, you ought to verify that the `ember_jquery.js` file is complete when loaded directly from the IP instead of via CF.

---

<div class="post-metadata">

### Author: ![guapic](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/guapic/32/127117_2.png) [@guapic](https://meta.discourse.org/u/guapic)
#### Post date: [December 20, 2018, 10:01pm UTC](https://meta.discourse.org/t/discourse-site-loads-via-ip-but-via-domain-only-header/104564/19 "2018-12-20T22:01:11Z")

</div>

OKay site now is off cloudflare however still just the header.

---

<div class="post-metadata">

### Author: ![guapic](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/guapic/32/127117_2.png) [@guapic](https://meta.discourse.org/u/guapic)
#### Post date: [December 20, 2018, 10:24pm UTC](https://meta.discourse.org/t/discourse-site-loads-via-ip-but-via-domain-only-header/104564/20 "2018-12-20T22:24:10Z")

</div>

The file is loaded correctly over the IP, no errors at all. I moved off cloudflare now but still experiencing the same issue

---

<div class="post-metadata">

### Author: ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)
#### Post date: [December 20, 2018, 11:32pm UTC](https://meta.discourse.org/t/discourse-site-loads-via-ip-but-via-domain-only-header/104564/21 "2018-12-20T23:32:36Z")

</div>

There is something very wrong with your setup such causing it to return truncated files.

A comparison of the file downloaded from your site with the same version of the file present on [another site](https://elixirforum.com/) (found by searching for that asset version) shows the same content right up until when yours gets truncated around 25% of the way into the file:

```diff
○ → diff -u <(sed -e 's/;/;\n/g' < guapic_ember_jquery-07f49b58317ea9292d939348ec0091eb50a9d8aaabd9e86cc074ef5f049918aa.js) <(sed -e 's/;/;\n/g' < elixir_ember_jquery-07f49b58317ea9292d939348ec0091eb50a9d8aaabd9e86cc074ef5f049918aa.js) | head
--- /dev/fd/63	2018-12-20 18:21:35.589330942 -0500
+++ /dev/fd/62	2018-12-20 18:21:35.589330942 -0500
@@ -1268,4 +1268,3443 @@
 return!1===l?["expr",n]:l}if(void 0!==a){var u=this.funcs[a],l=u(r,i,o,t);
 return!1===l?["expr",n]:l}return["expr",n]},e}();
 F(On,new An);
-var Sn=["javascript:","vbscript:"],Tn=["A","BODY","LINK","IMG","IFRAME","BASE","FORM"],kn=["EMBED"],Rn=["href","src","background","action"],Nn=["
\ No newline at end of file
+var Sn=["javascript:","vbscript:"],Tn=["A","BODY","LINK","IMG","IFRAME","BASE","FORM"],kn=["EMBED"],Rn=["href","src","background","action"],Nn=["src"],Pn={BUTTON:{type:!0,form:!0},INPUT:{type:!0,form:!0,autocorrect:!0,list:!0},SELECT:{form:!0},OPTION:{form:!0},TEXTAREA:{form:!0},LABEL:{form:!0},FIELDSET:{form:!0},LEGEND:{form:!0},OBJECT:{form:!0}},Dn={colgroup:{depth:2,before:"<table><colgroup>",after:"</colgroup></table>"},table:{depth:1,before:"<table>",after:"</table>"},tbody:{depth:2,before:"<table><tbody>",after:"</tbody></table>"},tfoot:{depth:2,before:"<table><tfoot>",after:"</tfoot></table>"},thead:{depth:2,before:"<table><thead>",after:"</thead></table>"},tr:{depth:3,before:"<table><tbody><tr>",after:"</tr></tbody></table>"}},jn="http://www.w3.org/2000/svg",In="http://www.w3.org/2000/svg",Ln={foreignObject:1,desc:1,title:1},Mn=Object.create(null);
+["b","big","blockquote","body","br","center","code","dd","div","dl","dt","em","embed","h1","h2","h3","h4","h5","h6","head","hr","i","img","li","listing","main","meta","nobr","ol","p","pre","ruby","s","small","span","strong","strike","sub","sup","table","tt","u","ul","var"].forEach(function(e){return Mn[e]=1});

```

File sizes:

```plaintext
164729 guapic_ember_jquery-07f49b58317ea9292d939348ec0091eb50a9d8aaabd9e86cc074ef5f049918aa.js
589450 elixir_ember_jquery-07f49b58317ea9292d939348ec0091eb50a9d8aaabd9e86cc074ef5f049918aa.js

```

---

<div class="post-metadata">

### Author: ![guapic](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/guapic/32/127117_2.png) [@guapic](https://meta.discourse.org/u/guapic)
#### Post date: [December 20, 2018, 11:54pm UTC](https://meta.discourse.org/t/discourse-site-loads-via-ip-but-via-domain-only-header/104564/22 "2018-12-20T23:54:27Z")

</div>

Thanks 😃 so what is the possible best solution for this? rebuilds are giving gateway errors.

[Next page](https://meta.discourse.org/t/discourse-site-loads-via-ip-but-via-domain-only-header/104564.md?page=2)
