2

I am trying to serve Mayan EDMS (a Django project) in a sub URI of another site. already checked and followed instructions from these posts:

1) https://gitlab.com/mayan-edms/mayan-edms/issues/350

2) How to host a Django project in a subpath?

3) https://docs.webfaction.com/software/django/config.html#mounting-a-django-application-on-a-subpath

here is part of my apache config:

  # Mayan in running on http://0.0.0.0:8000

  ProxyPass /mayan http://127.0.0.1:8000
  <Directory "/mayan">
      Options FollowSymLinks Indexes
      SetHandler uwsgi-handler
  </Directory>

  Alias "/mayan-static" "/opt/mayan/mayan-edms/media/static/"
  <Location "/mayan-static">
      SetHandler None
      Require all granted
  </Location>

I added these in the Django settings file:

USE_X_FORWARDED_HOST  = True
FORCE_SCRIPT_NAME     = '/mayan' 
BASE_PATH             = '/mayan'
STATIC_URL            = '/mayan-static/'
MEDIA_URL             = BASE_PATH + '/media/'

I expected that Mayan will be loaded in http://example.com/mayan, but it redirects to http://example.com/#/mayan and returns a 404 error.

Did I miss something? or did I do something wrong?

Roberto Rosario
  • 1,818
  • 1
  • 17
  • 31
JMill
  • 21
  • 2