Restart nginx by remote ssh

I’m trying to restart nginx after replacing the keys from pfsense. I’m using scp to copy keys and that part is working.

I’m geting this error when restarting

time=“2021-10-06T04:18:48-04:00” level=error msg=“Unexpected server response”
Unexpected server response

these are the commands I’ve tried
ssh [email protected] ‘ha addons restart core_nginx_proxy’
ssh [email protected] ha addons restart core_nginx_proxy