(تم استبداله) إعادة توجيه نطاق (نطاقات) إضافية إلى مثيل Discourse الخاص بك

Update DNS Record

Update the A record for the domain(s) you want to redirect to original domain.

It helped and so am sharing. If somebody trying to change the A Record for the route domain. Don’t use * in the hostname but @ in the hostname of Digitalocean DNS management.

Why are you using digital ocean for DNS? It would be out recommendation to stick with your registrar’s DNS unless you’re looking to use specific features which require moving, such as Cloudflare or Route 53.

Not sure what’s the disadvantage of that. But the reason why i do it is using the registrar only for buying domain and leave that alone. Then manage everything in DO. Also their interface looks easy to manage multiple domains and setup.

Here’s my issue:

If I redirect my naked domain example.com -> www.example.com using the instructions here, I have problems with my ssl certificate not being valid when going to example.com.

If I use NakedSSL to redirect example.com -> www.example.com. My cookies and therefore topics read seems to not display accurately.

What is the solution? I am using a docker install on digital ocean.

@techAPJ @codinghorror

You must redirect to the “correct” form that you have certs for. Content cannot be at multiple domains simultaneously, that is a configuration error, and Google will ding you for duplicate content.

إعجابَين (2)

Ok. I did get it working using the instructions as above. As you said my certificate probably hadn’t completely switched from the naked domain to the www domain.

However, I still have issues with discourse not remembering what I have read when I return to the root of the site. If I go straight to the root, all messages are shown as unread until I follow the latest and top links. Any idea what may be causing this behaviour?

Can someone please confirm these settings for me?

    - file:
        path: /etc/nginx/conf.d/www_redirect_1.conf
        contents: |
          server {
            listen 80;
            listen 443 ssl;
            server_name www.reddcointalk.org;
            return 301 https://reddcointalk.org$request_uri;
          }

The goal here is to redirect https://www.reddcointalk.org AND http://www.reddcointalk.org to https://reddcointalk.org. However, https://www.reddcointalk.org provides an SSL error. I’ve tried several different configurations of this but end up in the same place.

إعجاب واحد (1)

I suppose it works fine for you now; as the links mentioned are redirecting fine. I suppose you had to specify ssl_certificate and ssl_certificate_key. Can you please share your updated settings?

I wanted the visitors of hotelbobbygg.xyz be forwarded to already working https://a.hotelbobbygg.xyz.

I’ve did exactly as you told. (app.yml shown below) and then rebuilt the image.

But visitors of hotelbobbygg.xyz get the certificate error (and can’t add exception either). I’ve even tried incognito mode.

I was wondering, in the path line (i.e. the line just next to ‘-file’), do I only need to give some name such as ‘some_name.conf’ or do I need to create that same named file ‘some_name.conf’ somewhere, under some /etc/path?

This is a great start. So, the problem I’m running into here is that since the root domains (www and non-www) do not have SSL certs assigned to them by Let’s Encrypt in the docker container build we get an HTTPS error from the browser before the redirect even happens. Right? How do we add SSL to the root domains (www and non-www) so that this redirect will actually work?

Check out Setting up Let’s Encrypt with Multiple Domains. I used this yesterday to have the www.example.com site that I set up properly redirect https://example.com and it worked as expected.

إعجابَين (2)

هل كل هذا لا يزال صالحًا في عام 2021؟ أريد إعادة توجيه عنوان URL قديم إلى المضيف الجديد الخاص بي، ولكن إعداد Discourse الخاص بي هو موقع https://. يبدو أن التعليمات هنا لموقع http:// (المنفذ 80؟)
هل سيكون شخص ما لطيفًا بما يكفي لإظهار الخطوات اللازمة لإعادة التوجيه:
https://discourse.oldsite.com إلى
https://discourse.newsite.com

أنا أستخدم DO، وأفترض أنني بحاجة أيضًا إلى إضافة سجل CNAME في إعدادات الشبكة الخاصة بي يشير إلى الموقع القديم إلى الموقع الجديد؟
هل أحتاج أيضًا إلى القيام ببعض الأشياء مع LetsEncrypt؟
شكرا لمساعدتك!

يجب أن يعمل الموضوع المرتبط. يشرح كيفية إضافة بعض الأشياء إلى app.yml التي ستتسبب في حصول let’s encrypt على شهادة لكلا النطاقين الفرعيين. نعم، تحتاج إلى استخدام CNAME أو بخلاف ذلك جعل كلا النطاقين يحلان إلى القطرة الخاصة بك.

إعجاب واحد (1)

شكراً جزيلاً على ردك السريع.
إذن، أنا أحتاج فقط إلى القيام بالخطوات المفصلة في منشورك السابق ( إعداد Let’s Encrypt مع نطاقات متعددة )، وليس محتوى المنشور الأصلي أيضاً؟ (يشير المنشور الأصلي إلى المنفذ 80 فقط)

نعم. الشيء الوحيد في https://meta.discourse.org/t/setting-up-let-s-encrypt-with-multiple-domains/56685، أنا متأكد إلى حد معقول.

اضبط نظام أسماء النطاقات (DNS) بشكل صحيح للبدء وإلا ستصل إلى حدود المعدل.

3 إعجابات

أضيف هذه الكتلة إلى ملف app.yml الخاص بي

after_web_config:
  - replace:
      filename: /etc/nginx/nginx.conf
      from: /sendfile.+on;/
      to: |
        server_names_hash_bucket_size 64;
        sendfile on;
  - file:
      path: /etc/nginx/conf.d/discourse_redirect_1.conf
      contents: |
        server {
          listen 80;
          server_name mydomain.tld2;
          return 301 $scheme://mydomain.tld1$request_uri;
        }
after_ssl:
    - replace:
        filename: "/etc/runit/1.d/letsencrypt"
        from: /--keylength/
        to: "-d mydomain.tld2 -d mydomain.tld2 --keylength"

اسم النطاق الحالي الخاص بي هو mydomain.tld1، بعد إعادة البناء، يعمل mydomain.tld1 بشكل جيد ولكن عند محاولة الوصول إلى mydomain.tld2، تظهر رسالة ERR_CERT_COMMON_NAME_INVALID، والعكس صحيح (تبديل tld1 و tld2 في ملف .yml)

هل فاتني بعض الإعدادات؟

إعجاب واحد (1)

أعتقد أن شيئًا ما قد تغير في قالب Let’s Encrypt وأن شيئًا آخر مطلوب، لكنني لم أقضِ الوقت الكافي لتصحيح ذلك بالكامل بعد.

لدي نسخة من ديسكورس مُعدة على forum.mysite.ca عبر Digital Ocean. أرغب في توجيه mysite.ca إلى forum.mysite.ca واعتقدت أنني نجحت في ذلك، ولكن عندما أذهب إلى mysite.ca تظهر هذه الرسالة التحذيرية:
“اتصالك ليس خاصًا
قد يحاول المهاجمون سرقة معلوماتك من mysite.ca (على سبيل المثال، كلمات المرور أو الرسائل أو بطاقات الائتمان). اعرف المزيد
NET::ERR_CERT_COMMON_NAME_INVALID”
مع وجود زر “متقدم” يحتوي على رابط نصي يقول “المتابعة إلى mysite.ca (غير آمن)”.
لقد كنت أبحث عن الإجابة لمدة أسبوع وأواجه الكثير من المتاعب. أي نصائح أو روابط ستساعد.

هل لدى mysite.ca شهادة خاصة بها؟

لقد اتبعت هذا discourse/docs/INSTALL-cloud.md at main · discourse/discourse (github.com) ، لا أعتقد أنني قمت بإعداد شهادة لموقع mysite.ca الخاص بي.