I hardly find solution of Nginx configuration of my OJS server.
I try to run php 8 to run OJS with ubuntu 22.04.2. Been try How to run Open Journal System (OJS) on Nginx and no result.
Right now this is my Nginx conf :
server {
root /home/bappeda/public_html;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";
error_log /var/log/nginx/ejournal.deliserdangkab.go.id.log error;
index index.html index.php index.htm index.nginx-debian.html;
server_name ejournal.deliserdangkab.go.id;
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/ejournal.deliserdangkab.go.id/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/ejournal.deliserdangkab.go.id/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
location / {
index index.php index.html;
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;
fastcgi_pass unix:/var/run/php/php-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
location ~ /\.(?!well-known).* {
deny all;
}
}
server {
if ($host = ejournal.deliserdangkab.go.id) {
return 301 https://$host$request_uri;
} # managed by Certbot
server_name ejournal.deliserdangkab.go.id;
listen 80;
return 404; # managed by Certbot
}
Any help on this will be truly appreciated!