Hi and thank you for answering. I figured out both problems.
1. I put PHP code in header.php using a text editor and everythinkg works great now.
2. I forgot to chown the website directory recursively. So under linux command line I did chown -R nginx:nginx /path/to/website/folder without “/” at the end of folder name.
Thanks. Keep up the good work with this beautiful plugin 😉