Hello @gutiersa, @sjpadgett and @brady.miller. I am unable to bring up the Portal Dashboard from the Miscellaneous tab. Initially it was working on V6 but once i upgraded, i am unable to bring up the Portal Dashboard.
The error in the picture below shows up anytime i try to bring up the portal dashboard.
Operating System
Running OpenEMR on Ubuntu with NGINX and Proxy Manager. My OpenEMR instance is on a subdomain. i don’t know if it makes any difference.
Logs
NGINX error log is clean
Please see my NGINX configuration file below
server {
listen xxxx;
listen [::]:xxxx;
root /var/www/html/openemr;
index index.html index.php index.htm;
server_name xxxx.com;
location / {
#try_files $uri $uri/ =404;
try_files $uri $uri/ /index.php$is_args$args;
}
# pass PHP scripts to FastCGI server
#
location ~ \.php$ {
include snippets/fastcgi-php.conf;
#
# With php-fpm (or other unix sockets):
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
}
#If condition included to handle Patient Portal
if (!-e $request_filename) {
# Needed for zend to work
# rewrite ^(.*/zend_modules/public)(.*) $1/index.php?$is_args$args last;
# Needed for patient portal to work
rewrite ^(.*/portal/patient)(.*) $1/index.php?_REWRITE_COMMAND=$1$2 last;
# Needed for REST API/FHIR to work
rewrite ^(.*/apis/)(.*) $1/dispatch.php?_REWRITE_COMMAND=$2 last;
# Needed for OAuth2 to work
rewrite ^(.*/oauth2/)(.*) $1/authorize.php?_REWRITE_COMMAND=$2 last;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
deny all;
}
listen [::]:11443 ssl ipv6only=on; # managed by Certbot
listen 11443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/xxxx/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/xxxx/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 = xxxx.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen xxxx;
server_name xxxx.com;
return 404; # managed by Certbot
}
# pass PHP scripts to FastCGI server
#
location ~ \.php$ {
include snippets/fastcgi-php.conf;
#
# With php-fpm (or other unix sockets):
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
}
And place it after:
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
deny all;
}
and before the following line:
listen [::]:11443 ssl ipv6only=on; # managed by Certbot
In other words, your file needs to look like this:
server {
listen xxxx;
listen [::]:xxxx;
root /var/www/html/openemr;
index index.html index.php index.htm;
server_name xxxx.com;
location / {
#try_files $uri $uri/ =404;
try_files $uri $uri/ /index.php$is_args$args;
}
#If condition included to handle Patient Portal
if (!-e $request_filename) {
# Needed for zend to work
# rewrite ^(.*/zend_modules/public)(.*) $1/index.php?$is_args$args last;
# Needed for patient portal to work
rewrite ^(.*/portal/patient)(.*) $1/index.php?_REWRITE_COMMAND=$1$2 last;
# Needed for REST API/FHIR to work
rewrite ^(.*/apis/)(.*) $1/dispatch.php?_REWRITE_COMMAND=$2 last;
# Needed for OAuth2 to work
rewrite ^(.*/oauth2/)(.*) $1/authorize.php?_REWRITE_COMMAND=$2 last;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
deny all;
}
# pass PHP scripts to FastCGI server
#
location ~ \.php$ {
include snippets/fastcgi-php.conf;
#
# With php-fpm (or other unix sockets):
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
}
listen [::]:11443 ssl ipv6only=on; # managed by Certbot
listen 11443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/xxxx/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/xxxx/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 = xxxx.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen xxxx;
server_name xxxx.com;
return 404; # managed by Certbot
}
In nginx the order for the PHP block is important!
It really needs to be at the very end of the instructions. What I mean, is the re-writes also need to eventually be sent to the FastCGI server.
But wait, if it was working in openemr version 6, the order should not be a problem.
I have rearranged my nginx conf file like you stated above and restarted nginx but the problem still persists.
I checked php-fpm log and its clean.
I was wondering, in your nginx configuration file, there’s
include openemr.conf
Please did you include the openemr.conf script as part of what you shared earlier? Probably there’s something in there thats making it work.
My OpenEMR instance is being served on a subdomain. So the configuration file i posted is that of the subdomain. Do i need to move any script to the default NGINX configuration file?
Here is an important difference, with the explanation.
user www;
worker_processes auto;
worker_cpu_affinity auto;
worker_rlimit_nofile 51200;
# This default error log path is compiled-in to make sure configuration parsing
# errors are logged somewhere, especially during unattended boot when stderr
# isn't normally logged anywhere. This path will be touched on every nginx
# start regardless of error log location configured here. See
# https://trac.nginx.org/nginx/ticket/147 for more info.
#
error_log /var/log/nginx/error.log;
#
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
It is regarding an error_log directive prior to the HTTP segment.