Manage modules facing Nginx- 404 Not Found

Hi,

Deployed openemr-6.0.0 on Nginx web server instead of apache2.
Modules > manage modules
loading page for 1 second as I can see message “loading manage modules…” and page goes “Nginx 404 Not found”. attached screen-shots on same.


The same issue I cleared in apache2 by adding below lines in apache2 config file(000-default.conf)

<Directory /var/www/html>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted

Where as in Nginx webserver, how to enable such parameters like "AllowOverride " in nginx config file.

Regards,
Dhayananda

hi @Dhayananda_T, does this help? looks like the dockers use this block, a lot of the rest of this configuration file is specific to a crazy testing environment :slight_smile:

@stephenwaite, I have seen same reference link for nginx and still not familiar what to do and how to enable same. Below are the nginx config(default) file.

server {
listen 80 ;
listen 443 ssl ;
root /var/www/html;
index index.php index.html index.htm index.nginx-debian.html;
server_name abc.xxxx.com; # managed by Certbot

   #	location / {
	# First attempt to serve request as file, then
	# as directory, then fall back to displaying a 404.
   #	try_files $uri $uri/ =404;
   #}

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
	include snippets/fastcgi-php.conf;

#	# With php7.0-cgi alone:
#	fastcgi_pass 127.0.0.1:9000;
#	# With php7.0-fpm:
	fastcgi_pass unix:/run/php/php7.3-fpm.sock;
}

# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
#	deny all;
#}

ssl_certificate /etc/letsencrypt/live/abc.xxxx.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/abc.xxxx.com/privkey.pem;
}

how to enable such parameters like “AllowOverride” to clear the Nginx-404 not found.

regards,

Dhayananda.T

hi @stephenwaite,

thanks for support.

Regards,
Dhayananda.T

Nginx works differently from apache. There is no equivalency in the lines. For starters, this block is required:

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;
    }

You are missing the following line which tells nginx to serve all static content:

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

Finally, here you are passing the php scripts to the php-fpm:

location ~ \.php$ {
  include snippets/fastcgi-php.conf;
  # With php7.0-cgi alone:
  # fastcgi_pass 127.0.0.1:9000;
  # With php7.0-fpm:
  fastcgi_pass unix:/run/php/php7.3-fpm.sock;
  fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
}

This is very basic and extremely insecure.
In a production environment I would forward all requests coming in on port 80 to port 443.

Thanks for your support.

I can able to download the Continuity of Care Record (CCR) in Reports >

Report Content in the patient dashboard, the xxx-ccr.zip file is

downloaded. when I tried to Generate the Report, it shows blank page.

Regards,
Dhayananda.T