Nginx
Service overwiev
| Software owner | NGINX Inc |
|---|---|
| Version | 1.12.2 |
| System requirements | |
| Management | wfmanager (start | stop | restart | status) nginx |
| Log files | Access logs: ${install_dir}/supervisord/log/nginx.out.log |
| Startup scripts | ${install_dir}/supervisord/apps/nginx.ini ${install_dir}/nginx/run_nginx.sh |
| Configuration files | Service directory: ${install_dir}/nginx/ |
| Default Ports | tcp 8080, 8443 |
Default parameters
| Configuration file | Name | Default Value | Description |
|---|---|---|---|
| config.yml | install_dir |
/opt/workfusion | Directory to put user files, logs and configs |
| config.yml | nginx_{role}_port | 8080 | Default service port for NON-SSL installation |
| config.yml | nginx_{role}_port_ssl | 8443 | Default service port for SSL installation |
| secrets.yml | NGINX CERTIFICATES | Certificates name from certificates/ directory |
Troubleshooting
Check the configuration for syntax errors or warnings:
${install_dir}/nginx/bin/nginx -p ${install_dir}/nginx -c nginx.conf -tA successful result is as follows:
$ nginx/bin/nginx -p nginx -c nginx.conf -t nginx: the configuration file nginx/nginx.conf syntax is ok nginx: configuration file nginx/nginx.conf test is successfulCheck if TCP ports 8080 and 8443 are available.
Ports may be custom:
netstat command output
$ netstat -lntp | grep nginx tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 21145/nginx: master tcp 0 0 0.0.0.0:8443 0.0.0.0:* LISTEN 21145/nginx: masterss command output
$ ss -ltn | egrep '8080|8443' LISTEN 0 511 *:8080 *:* LISTEN 0 511 *:8443 *:*lsof command output
$ lsof -P -n -i :8080 -i :8443 | grep LISTEN nginx 21145 wfuser 4u IPv4 568975 0t0 TCP *:8080 (LISTEN) nginx 21145 wfuser 6u IPv4 568977 0t0 TCP *:8443 (LISTEN) nginx 21147 wfuser 4u IPv4 568975 0t0 TCP *:8080 (LISTEN) nginx 21147 wfuser 6u IPv4 568977 0t0 TCP *:8443 (LISTEN) nginx 21148 wfuser 4u IPv4 568975 0t0 TCP *:8080 (LISTEN) nginx 21148 wfuser 6u IPv4 568977 0t0 TCP *:8443 (LISTEN)Count the number of running Nginx processes. This should not be less than 1.
pgrep command output
pgrep nginx | wc -lCheck the default log files:
- Access logs:
${install_dir}/supervisord/log/nginx.out.log - Error logs:
${install_dir}/supervisord/log/nginx.err.log
$ tail -f ${install_dir}/supervisord/log/nginx.err.log ${install_dir}/supervisord/log/nginx.out.log- Access logs:
Check Nginx out (access) log using the Wfmanager util:
wfmanager tail nginxCheck the permissions and full path access to the files accessed by Nginx
$ namei -om /opt/workfusion/nginx/var/www/tinymce/js/tinymce/themes/inlite/src/demo/html/demo.html f: /opt/workfusion/nginx/var/www/tinymce/js/tinymce/themes/inlite/src/demo/html/demo.html dr-xr-xr-x root root / drwxr-xr-x root root opt drwxr-x--- wfuser wfuser workfusion drwxr-xr-x wfuser wfuser nginx drwxrwxr-x wfuser wfuser var drwxrwx--- wfuser wfuser www drwxrwxr-x wfuser wfuser tinymce drwxrwxr-x wfuser wfuser js drwxrwxr-x wfuser wfuser tinymce drwxrwxr-x wfuser wfuser themes drwxrwxr-x wfuser wfuser inlite drwxrwxr-x wfuser wfuser src drwxrwxr-x wfuser wfuser demo drwxrwxr-x wfuser wfuser html -rwxrwxr-x wfuser wfuser demo.htmlEnable debug information.
Set the appropriate log level to
${install_dir}/nginx/nginx.conf(default is info) and restart the Nginx service:${install_dir}/nginx/nginx.conferror_log stderr debug;wfmanager restart nginxCheck if DNS is configured properly. On most systems,
/etc/hostshas a priority over DNS resolution. Thus, check the contents of that file. In any case, DNS records should be in place and you can verify them with:$ host -t A app.example.com app.example.com has address 172.31.38.110Getent output should be IPv4:
$ getent hosts app.example.com 172.31.38.110 app.example.comFull DNS record resolution:
$ dig -t A +trace app.example.com