Coding Stephan

Nginx fault finding

I had an issue with a NGINX server not starting after an upgrade, sudo nginx -t did not help.

I was faced with this:

> sudo nginx -t
nginx: [emerg] unknown "optin_login" variable
nginx: configuration file /etc/nginx/nginx.conf test failed

but optin_login was not in the config.

GREP to the help

grep -rnw '/etc/nginx' -e 'optin_login'

And tada found the exact location where this missing variable was used.

/etc/nginx/sites-available/just.kidding.not.real:31:      if ($optin_login = no) {
/etc/nginx/sites-available/also.not.real:47:      if ($optin_login = no) {
/etc/nginx/conf.d/map-country.conf:15:#map $geoip_country_code $optin_login {

Connect with me

LinkedIn Profile Link Mastodon Follow on Twitter My MVP profile Check my blog