docker-ojs icon indicating copy to clipboard operation
docker-ojs copied to clipboard

Trouble installing in sub folder of the domain

Open jbogdani opened this issue 1 year ago • 1 comments

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

jbogdani avatar Feb 07 '24 21:02 jbogdani

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.

marcbria avatar Feb 28 '24 10:02 marcbria