# Open edX behind apache hosting proxy

**URL:** <https://discuss.openedx.org/t/open-edx-behind-apache-hosting-proxy/11634>\
**Category:** Development\
**Tags:** how-to, tutor\
**Created:** [November 9, 2023, 2:55pm UTC](https://discuss.openedx.org/t/open-edx-behind-apache-hosting-proxy/11634 "2023-11-09T14:55:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![blazejwiecha](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/blazejwiecha/32/6085_2.png) [@blazejwiecha](https://discuss.openedx.org/u/blazejwiecha)\
**Post date:** [November 9, 2023, 2:55pm UTC](https://discuss.openedx.org/t/open-edx-behind-apache-hosting-proxy/11634/1 "2023-11-09T14:55:21Z")

</div>

Hello  
I am trying to put openedx tutor behind apache2 proxy. How to configure it to work correctly and automatically forward to caddy on port 81 for example ?

---

<div class="post-metadata">

**Author:** ![blazejwiecha](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/blazejwiecha/32/6085_2.png) [@blazejwiecha](https://discuss.openedx.org/u/blazejwiecha)\
**Post date:** [November 28, 2023, 9:16am UTC](https://discuss.openedx.org/t/open-edx-behind-apache-hosting-proxy/11634/2 "2023-11-28T09:16:12Z")

</div>

I found a little help over net … so here they are 🙂

on sites-enabled create a site.conf  
inside the file

```auto
<VirtualHost *:80>

  #Niezbedne by "oszukac" serwer caddy ze zapytania przychodza z tej domeny a nie z localhost
  ProxyPreserveHost On
  ServerName edx.local

  #Najpierw adresy serwisow cud ...
  ProxyPass /cudserver http://localhost:8080/cudserver
  ProxyPassReverse /cudserver http://localhost:8080/cudserver

  ProxyPass /restapi http://localhost:8080/restapi
  ProxyPassReverse /restapi http://localhost:8080/restapi

  ProxyPass /cud-math http://localhost:8080/cud-math
  ProxyPassReverse /cud-math http://localhost:8080/cud-math

  ProxyPass /cud-code http://localhost:8080/cud-code
  ProxyPassReverse /cud-code http://localhost:8080/cud-code
  
  #... a na koncu przekierowanie root zeby poprzednie zostaly uwzglednione 
  ProxyPass / http://127.0.0.1:8010/
  ProxyPassReverse / http://127.0.0.1:8010/

</VirtualHost>

```

also found a way in https:

```auto
<VirtualHost *:80>
  # Redirect HTTP requests to HTTPS
  ServerName edx.local

  Redirect permanent / https://edx.local/

  ProxyPass / http://localhost:8010/
  ProxyPassReverse / http://localhost:8010/

</VirtualHost>

<VirtualHost *:443>
  ServerName edx.local
  
# # SSL Configuration
  SSLEngine on
 SSLCertificateFile /local_cert/certificate.crt
  SSLCertificateKeyFile /local_cert/private.key

   ProxyPass configurations for different paths
  ProxyPreserveHost On

  ProxyPass /cudserver http://localhost:8080/cudserver
  ProxyPassReverse /cudserver http://localhost:8080/cudserver

  ProxyPass /restapi http://localhost:8080/restapi
  ProxyPassReverse /restapi http://localhost:8080/restapi

  ProxyPass /cud-math http://localhost:8080/cud-math
  ProxyPassReverse /cud-math http://localhost:8080/cud-math

  ProxyPass /cud-code http://localhost:8080/cud-code
 ProxyPassReverse /cud-code http://localhost:8080/cud-code

  ProxyPass /authn http://localhost:8010/authn
  ProxyPassReverse /authn http://localhost:8010/authn

  ProxyPass / http://127.0.0.1:8010/
  ProxyPassReverse / http://127.0.0.1:8010/
</VirtualHost>

```

but still … 0auth not working correctly … and no way to go to login/register
