Create a new user for nginx and set the permissions.
sudo /usr/sbin/usermod -s /bin/bash nginx
sudo passwd nginx
sudo service nginx stop
sudo service php-fpm stop
sudo /usr/sbin/usermod -d /var/www/html nginx
sudo service nginx start
sudo service php-fpm start
sudo mkdir /var/www/html/.ssh
sudo cp /home/ec2-user/.ssh/authorized_keys /var/www/html/.ssh/
sudo chown -R nginx:nginx /var/www/html/.ssh/
sudo vi /etc/ssh/sshd_config
PasswordAuthentication yes
sudo service sshd restart
sudo chown -R nginx:nginx /var/www/html
sudo chmod -R 755 /var/www/html