Image upload and 404 error after changing domain


(Marianne Santala) #1

Hi,

I have similar issue with my Discourse site after changing domain and the name of subfolder. My Discourse was a-domain.com/talk and I changed it to b-domain.com/forum.

It was working fine before the change. Now I can’t download category logos and Debugger gives:

Error while fetching an original source: request failed with status 404 Source URL: https://b-domain.com/assets/_ember_jquery27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js

I think I have changed all the settings from old to the new domain.

I also tried discourse remap, but didn’t seem to change anything.

Do you have any suggestions, what I could try next?


(Jay Pfaffman) #2

Have you rebaked the posts?


(Marianne Santala) #3

Yes, here is what I did:

./launcher enter app
discourse remap a-domain.com/talk b-domain.com/forum
rake posts:rebake


(Marianne Santala) #4

After this, I didn’t see any change, then I did:

discourse remap https://a-domain.com/talk/uploads https://b-domain.com/forum/uploads

Then I noticed, in the category logo source path there is “/forum/talk/uploads”. This should be “/forum/uploads”. I tried to fix it with:
discourse remap '/forum/talk/uploads' '/forum/uploads'
rake posts:rebake


(Marianne Santala) #5

In addition, when I edit category and click save, the page returns to https://b-domain.com/c/category_name and this doesn’t exist. It should return back to https://b-domain.com/forum/c/category_name

I checked my app.yml and noticed following lines:

 filename: /etc/nginx/conf.d/discourse.conf
 from: proxy_pass http://discourse;
 to: |
    rewrite ^/(.*)$ /forum/$1 break;
    proxy_pass http://discourse;

Should I change proxy_pass http://discourse; to proxy_pass http://b-domain.com;?

I’m sorry for dumb questions, doing this for the first time.:sweat_smile:


(Mittineague) #6

So you not only changed the domain name, but also to a subfolder?


(Marianne Santala) #7

It was already in subfolder before changing domain name, I just changed the name of subfolder at the same time with changing domain. I had problem with uploaded figures also before the domain name change, but category logos worked normally. Now I cannot even upload new category logo, it says something like “upload failed, try again”.