pkp / docker-ojs

Open Journal Systems (OJS) is a journal management and publishing system.
GNU General Public License v3.0
60 stars 47 forks source link

Trouble installing in sub folder of the domain #344

Open jbogdani opened 7 months ago

jbogdani commented 7 months ago

Hello,

I'm having issues installing the docker version in a subdomain. Let's assume my main domain is example.com and I want my OJS installation to be available at example.com/ojs.

I changed in .env the PROJECT_DOMAIN variable:

PROJECT_DOMAIN=example.com/ojs

I also changed volumes/config/ojs.config.inc.php:

base_url = "https://example.com/ojs"

And here is my nginx reverse proxy settings:

location /ojs/ {
       rewrite ^/ojs/(.*)$ /$1 break;
       proxy_pass http://127.0.0.1:8081/;
    }

The problem is that when I try to access my installation at https://example.com/ojs, I get redirected to https://example.com/index.php/index/installwhich does not exist (sinceojs` subdirectory is missing).

If I type https://example.com/ojs/index.php/index/install I get the installation page with missing scripts and style-sheets, since these refer to the domain's root.

I guess I am missing something very basic here and any help is much appreciated.

Julian

marcbria commented 6 months ago

Hi @jbogdani

I don't know if you already fixed it.

If not, some suggestions:

  1. PROJECT_DOMAIN is just the domain, not the url, so it should be something like:
    PROJECT_DOMAIN=example.com
  2. base_url if fine, but sometimes is even better don't set it and let OJS decide

Said that, I'm not working with nginx mysqlf (I use apache that is PKP's recommendation for OJS, and with traefik as revierse proxy) so I don't know much about it but reading your reverse proxy settings, could be this line the culpit?

rewrite ^/ojs/(.*)$ /$1 break;

If I understand it well is where the /ojs slug is removed.