NGINX systemd: PID file /run/nginx.pid not readable (yet?)

We got this error when trying to create a service out of the NGINX service. In order to resolve this issue the nginx.conf needed to be update to point to the correct PID location. Note, this should match the systemd module pid location

Apr 19 17:42:21 centos03 systemd: Starting The NGINX HTTP and reverse proxy server...
Apr 19 17:42:21 centos03 nginx: nginx: the configuration file /opt/nginx/conf/nginx.conf syntax is ok
Apr 19 17:42:21 centos03 nginx: nginx: configuration file /opt/nginx/conf/nginx.conf test is successful
Apr 19 17:42:21 centos03 systemd: PID file /run/nginx.pid not readable (yet?) after start.
Apr 19 17:42:46 centos03 systemd: Stopped The NGINX HTTP and reverse proxy server.
Apr 19 17:43:06 centos03 systemd: Starting The NGINX HTTP and reverse proxy server...
Apr 19 17:43:06 centos03 nginx: nginx: the configuration file /opt/nginx/conf/nginx.conf syntax is ok
Apr 19 17:43:06 centos03 nginx: nginx: configuration file /opt/nginx/conf/nginx.conf test is successful
Apr 19 17:43:06 centos03 systemd: PID file /run/nginx.pid not readable (yet?) after start.

Edit the nginx.conf file

[root@centos03 ~]# vi /opt/nginx/conf/nginx.conf

Find the pid location

#pid        logs/nginx.pid;

And update it

pid        /run/nginx.pid;

Now try staring the nginx service again

[root@centos03 ~]# systemctl start nginx.service
[root@centos03 ~]# ps -ef | grep nginx
root      5875     1  0 17:48 ?        00:00:00 nginx: master process /opt/nginx/sbin/nginx
nobody    5876  5875  0 17:48 ?        00:00:00 nginx: worker process
root      5878 14385  0 17:48 pts/1    00:00:00 grep --color=auto nginx