# كيفية تثبيت Discourse خلف Apache mod\_proxy؟

**URL:** <https://meta.discourse.org/t/how-to-install-discourse-behind-apache-mod-proxy/130763>\
**Category:** Self-hosting\
**Created:** [11 أكتوبر 2019، 7:38ص UTC](https://meta.discourse.org/t/how-to-install-discourse-behind-apache-mod-proxy/130763 "2019-10-11T07:38:52Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![hexadecagram](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hexadecagram/32/262658_2.png) [@hexadecagram](https://meta.discourse.org/u/hexadecagram)\
**Post date:** [11 أكتوبر 2019، 7:38ص UTC](https://meta.discourse.org/t/how-to-install-discourse-behind-apache-mod-proxy/130763/1 "2019-10-11T07:38:52Z")

</div>

مرحبًا بالجميع.

أحاول إعداد Discourse في حاوية Docker. بيئة المضيف (Debian) تشغل خادم Apache httpd (لا يمكنني تشغيل nginx لأنني أستضيف مواقع أخرى على Apache). أريد استخدام mod\_proxy لعمل عكسي (reverse-proxy) إلى الحاوية، والتي تستمع على المنفذ 3000.

إليك تكوين Apache الحالي لهذا الـ vhost:

```
<VirtualHost *:80>
  ServerAdmin webmaster@example.com
  ServerName example.com
  ServerAlias www.example.com

  ErrorLog ${APACHE_LOG_DIR}/vhosts/example.com/error.log
  CustomLog ${APACHE_LOG_DIR}/vhosts/example.com/access.log combined

  <IfModule proxy_module>
  ## <https://meta.discourse.org/t/running-other-websites-on-the-same-machine-as-discourse/17247>
    ProxyPreserveHost on
    RequestHeader set X-Forwarded-Proto expr=%{REQUEST_SCHEME}
    RequestHeader set X-Real-IP expr=%{REMOTE_ADDR}
    ProxyPass / http://localhost:3000/
    ProxyPassReverse / http://localhost:3000/
  </IfModule>
</VirtualHost>

```

بدأت فقط بتعليمات ProxyPass و ProxyPassReverse، ثم أضفت ProxyPreserveHost وتعليمات RequestHeader واحدة تلو الأخرى. بغض النظر عن كيفية تكوين الوكيل باستخدام هذه التعليمات، فإن بعض الملفات الموجودة تحت جذر المستند تعيد خطأ 404 عند الوصول إليها (مثل الملفات الموجودة في /images و /assets).

لاحظ التعليق الذي يحتوي على عنوان URL الخاص بـ Discourse Meta والذي قمت بتحويله من صيغة nginx إلى Apache.

أي أفكار حول كيفية جعل هذا يعمل ستكون موضع تقدير كبير!

---

_[View the full topic](https://meta.discourse.org/t/how-to-install-discourse-behind-apache-mod-proxy/130763)._
