I cannot reproduce this on Ubuntu Server 18.04 LTS using the stock NginX and Apache FPM. I did have to modify the "fastcgi_pass code block setting (read the documentation)" option and I did not include Joomla's stock NginX configuration (as documented in docs.joomla.org) since Admin Tools' NginX Conf Maker supersedes that.
So, please do let me comment on the two things I understand you are doing wrong.
The PHP passthrough code you added in "fastcgi_pass code block setting (read the documentation)" seems to be wrong
according to the rest of your configuration file that you posted in your last reply. In short, you need to include the stuff that's inside the location ~ \.php$ block WITHOUT the opening "location ~ \.php$ {" and closing "}". In other words, in your case it is:
fastcgi_pass unix:/var/run/php/php7.2-fpm-example.sock;
fastcgi_index index.php;
include /etc/nginx/fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
If you get that code wrong you will get either a blank page or a 502 gateway error. Or, if you truly screw it up, you will be downloading the raw PHP source code instead of having it executed.
IF YOU ARE NOT 100% SURE DO NOT ASK ME TO TELL YOU WHAT IS CORRECT AND WHAT IS WRONG. I HAVE NOT SET UP YOUR SERVER. I CANNOT GUESS RELIABLY HOW YOUR SERVER IS SET UP. IF THAT WAS POSSIBLE IT WOULD BE A FEATURE IN ADMIN TOOLS ITSELF. WHEN IN DOUBT ALWAYS ALWAYS ALWAYS ALWAYS ALWAYS ALWAYS ALWAYS ALWAYS ALWAYS ASK THE PERSON WHO SET UP YOUR SERVER. THEY ARE THE ONE AND ONLY PERSON IN THE ENTIRE UNIVERSE WHO CAN TELL YOU WITHIN ANY DEGREE OF ACCURACY WHAT YOU NEED TO PUT IN AN NginX location BLOCK TO HAVE A .php FILE PASS-THROUGH, i.e. EXECUTE THAT PHP FILE AS A SCRIPT AND STOP PROCESSING ANY OTHER NGINX CONFIGURATION STATEMENTS.
Sorry for the all caps, bold and red color but this is VERY important. You have already asked me twice to verify what you used. What you used LOOKS right to me BUT I have not set up YOUR server. The last thing you used is the same thing I was using in my Ubuntu 16.04 server. My Ubuntu 18.04 server, however, needed something entirely different. Again, it's absolutely important to ask the person who set up your server how your NginX installation can be coerced to run a .php file as script instead of doing something else with it. And yeah, everyone is using PHP-FPM with NginX (it's the only way, actually) but
how exactly it is set up and
where you have the configuration file (and their includes, if any) is 100% up to the person configuring the server. That's why I am insisting that you need to ask the person who set up your server.
Finally and very importantly, you are including the file /etc/nginx/conf/joomla.conf. I suppose that this is the file Joomla mentions in the https://docs.joomla.org/Nginx documentation page.
Do not do that. This WILL break your site in the way that you describe your site is broken. Admin Tools' NginX Conf Maker
supersedes Joomla's NginX configuration in the same way Admin Tools' .htaccess Maker supersedes Joomla's built-in .htaccess file. Comment out that line.
Nicholas K. Dionysopoulos
Lead Developer and Director
🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!