Describe the problem you would like to solve
Any OJS project that is in production will need to set up an nginx or apache webserver. Unfortunately, PKP does not provide any examples of what is required for the .conf files.
Describe the solution you’d like
I propose that the OJS project ships with default versions of the nginx and apache .conf files that should work on a standard linux server. The files could be named something like ojs-apache.conf.sample.
Who is asking for this feature?
I would like to set up my own OJS server for testing (on a remote VM, not locally), and eventually migrate our OJS instance from our library to a non-profit organization.
As we host domain, subdomain, and folder journals (in single-tenant mode, behind a reverse-proxy), I have been dealing with Apache conf issues for years, and it is, by far, the most annoying and time-consuming task related to OJS that I have to do.
In the official container images I added a minimal/simplistic apache.conf, but this won’t cover usual/real production scenarios:
In this other project, you will see an extended version, but since it’s a template trying to cover all the bases, it’s probably too complex:
My conclusion, after all those years, is this is a really tricky petition because lot’s of things could collide (journal config.inc.php settings, proxy settings, domain/subdomain/folder url, protocol…) but I also think that would be great to have a commented htaccess.TEMPLATE for admins with generic recommendations about how to deal with different scenarios.
Well… I’ll deny having said this (I’m not a big fan of IAs), but LLMs have been doing a good job at translating for a while now, so you could start from the general “dojo” model, ground it in your context (there’s no point in creating rules for cases you’re not going to use), confirm that it works with Apache, and then ask it to translate those rules to nginx.
You’ll have to do some testing, but if you start from a correct config.inc.php and apache.conf, the move to nginx should be simpler.
I myself am now adapting the dojo rules to OJS 3.5, and it’s more or less the path I’m going to follow.
In any case, aside from specific problems in our contexts, a well-documented htaccess seems like a must for the collective project.
I’ve always used Nginx and these rules have been working just fine for OJS. Here is an example, that might be helpfull.
nginx.conf
http {
# (...other rules...)
upstream php8 {
# set this to your server PHP configuration
server unix:/run/php/php8.1-fpm.sock;
}
include my_ojs_server.conf;
}
my_ojs_server.conf
server {
server_name my_ojs_server.com;
# this is where OJS files are installed:
root /var/www/my_ojs_server;
location / {
try_files $uri $uri/ /index.php$request_uri;
include php8-fpm.conf;
}
# other general rules
# include default_settings.conf;
}