Malformed URLs - missing trailing slash with root .community TLD


(Rimian Perkins) #1

I’m seeing a few URLs missing the trailing slash but I’m unable to identity where this is occurring.

This is one way that I can reproduce the error (hard to test!)

  1. Click on “unsubscribe” in the digest email.
  2. Click on the unsubscribe button

I expect to see a page with something on it but instead I see:

“This site can’t be reached”

and there is a missing forward slash between the URL and the path “email/unsubscribed”

If I click on other links in the email, it works fine. I’m using sendgrid which does a redirect but I’m unsure if the problem is a sendgrid setting or something in discourse.

I have heard reports of users seeing other similar errors but I’m not able to get any reliable info yet.

Can anyone please point me in the right direction? Much appreciated.


(Jeff Atwood) #2

If @sam can repro those steps in the unsubscribe I am sure we can fix it. Seems really narrow to me, but OK :wink:


(Rimian Perkins) #3

Thanks for the quick reply.

Just by chance, I found this error again!

  1. When I am logged out and on the home page
  2. Click on a topic (URL is as I expect)
  3. Click “Login” button in the banner/header
  4. Enter username and password in the dialog box
  5. Click “login” in the dialog

I am redirected to a 404. The path looks the same as the second step but the forward slash after the URL is missing.


(Jeff Atwood) #4

No repro. Have you tried this in a clean browser install? I suspect something in your browser is interfering.

(I am using Chrome, stock, no plugins)


(Rimian Perkins) #5

I’ll check in other browsers and my staging server. Also, I’ll ask the rest of our staff to check.

Thanks for eliminating that! I’ll post here.


(Rimian Perkins) #6

It happens on safari and our staging server.

I’m wondering if it’s our URL: https://choice.community

This site is invite only at this stage but I can invite if you message me :slight_smile:


(Jeff Atwood) #7

Almost certainly the URL! Good catch


(Rimian Perkins) #8

I think it was a misconfiguration in the proxy redirect. I followed Digital Ocean’s instructions to enable HTTPS.

The line

proxy_redirect http://discourse.example.com:25654/ https://discourse.example.com;

should be

proxy_redirect http://discourse.example.com:25654/ https://discourse.example.com/;

That seemed to fix it!