Module installation for Apache si Nginx requires changes to the configuration files. nginx.conf, In our case.
For novice users, changing lines and directives in nginx.conf it can be an extreme sport, especially if I don't understand how blocks work Nginx.
The error "nginx: [emerg] "load_module" directive is specified too late in nginx.conf"Is most common when adding a NGINX module after it has been installed. Solving it is very simple and we must do nothing but put the module lines at the top of nginx.conf.
Compared to other configuration files, NGINX executes the directives, definitions and conditions in the order in which they are passed to the nginx.conf file.
A concrete example. If we install Brotli module for NGINX, the module load lines must be immediately after the NGINX process id, so that the following specific lines take into account these modules and the process runs correctly.
After you change the location of the module loading lines, execute the command
nginx -t in SSH to make sure everything is ok and there are no other errors. Restart the NGINX service for the changes in nginx.conf to take effect.