OJS, NGINX and restoring journal

hi!

I hope this post finds you all well. I manage a small journal (non profit, minimal resources) and we have our mail with mail in a box (contacto@lenguasradicales.cl). After updating to OJS 3.3.0-10 the site redirects to my github, which is the default for another site I have in the same server.

This is my NGINX configuration file

server {

    server_name ojs.lenguasradicales.cl; #change your domain here

    root /home/administrador/ojs.lenguasradicales.cl/ojs-current; #change the path to your site's root directory, where config.inc.php resides
    index index.php index.html index.htm;

    location / {
       try_files $uri $uri/ /index.php?$args;
    }

    location ~ ^(.+\.php)(.*)$ {
        set $path_info $fastcgi_path_info;
        fastcgi_split_path_info ^(.+\.php)(.*)$;
        fastcgi_param   PATH_INFO               $path_info;
        fastcgi_param   PATH_TRANSLATED         $document_root$path_info;

        if (!-f $document_root$fastcgi_script_name) {
            return 404;
        }

        include fastcgi_params;
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    }

    location ~ /\.ht {
        deny all;
    }

    access_log /var/log/nginx/access-ojssite.log;
    error_log /var/log/nginx/error-ojssite.log;

    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/ojs.lenguasradicales.cl/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/ojs.lenguasradicales.cl/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}
server {
    if ($host = ojs.lenguasradicales.cl) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


    listen 80;

    server_name ojs.lenguasradicales.cl;
    return 404; # managed by Certbot


}

How can I get the OJS site to work again?

Also, where should I indicate the new OJS files directory? I already restored the SQL dump I created just in case alongside a copy of all the files.

Hello @pachadotdev

Here is our base Nginx vhost config that we implement for our client for the Nginx+PHP-FPM config :

server {
  server_name example.com;
  root /location_of_your_ojs_folder;
  index index.php;
    location ~ ^/index.php($/) {   
        set $path_info $fastcgi_path_info;
        fastcgi_split_path_info ^(.+.php)(.)$;
        fastcgi_param PATH_TRANSLATED $document_root$path_info;
        fastcgi_split_path_info ^(.*?\.php)(/.*)$;
        fastcgi_pass localhost:8005;
        include fastcgi_params;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        fastcgi_param  PATH_INFO $fastcgi_path_info;
        client_max_body_size 40M;
    }
}

You can configure based on that config to be used on your environment since we are using an automated docker system on our host environment so if you have any issues, you can tweak the config to suit your environment.

Regards
Hendra
OJT Team

2 Likes

Thanks !! At least now I get a 502 error. The only part I don’t get is how to make the site available. I followed Install Open Journal System (OJS) on Debian/Ubuntu - LIBTECHNOPHILE and now this because my server has NGINX.

If possible, I suggest using apache because it is easier for OJS to configure using that webserver.

Thank
Hendra

1 Like

hello , it is true , with nginx i cannot get up the systema

i do not know why does it happen that… i have all routed well, but is there any site where indicates some method for nginx?