My changes to the configuration files are gone when I restart the servers

All configuration files (httpd.conf, nginx.conf, php.ini, my.cnf, …) are newly created when the servers are started. Appropriate templates are used as a basis. If you want to make changes to the configuration files, you must make these changes in the templates.

You can access the templates via the menu of MAMP PRO: "File > Open Template".

Please note that errors in the templates can cause the servers to stop starting.