Files
proxmox/scripts/configure-nginx-jwt-auth-FIXES.md
defiQUG cb47cce074 Complete markdown files cleanup and organization
- Organized 252 files across project
- Root directory: 187 → 2 files (98.9% reduction)
- Moved configuration guides to docs/04-configuration/
- Moved troubleshooting guides to docs/09-troubleshooting/
- Moved quick start guides to docs/01-getting-started/
- Moved reports to reports/ directory
- Archived temporary files
- Generated comprehensive reports and documentation
- Created maintenance scripts and guides

All files organized according to established standards.
2026-01-06 01:46:25 -08:00

2.3 KiB

Nginx JWT Auth Script - Fixes Applied

Issues Fixed

1. Missing Package Error

Problem: Script was trying to install libnginx-mod-http-lua which doesn't exist as a separate package in Ubuntu 22.04.

Fix: Removed the attempt to install libnginx-mod-http-lua separately. The script now:

  • Removes nginx-core if present
  • Installs nginx-extras which includes Lua support built-in
  • Falls back to regular nginx if nginx-extras is not available

2. Locale Warnings

Problem: Multiple locale warnings cluttering the output:

  • perl: warning: Setting locale failed
  • locale: Cannot set LC_CTYPE to default locale
  • dpkg-preconfigure: unable to re-open stdin

Fix: Added locale suppression to all command executions:

  • Set export LC_ALL=C and export LANG=C in all bash sessions
  • Filtered locale warnings from apt-get output using grep -vE "(perl: warning|locale:|dpkg-preconfigure)"

Changes Made

Package Installation Section (Lines 42-66)

  • Removed attempt to install libnginx-mod-http-lua
  • Added proper nginx-core removal before installing nginx-extras
  • Added locale environment variables
  • Added output filtering for locale warnings

JWT Secret Generation (Lines 68-85)

  • Added locale environment variables
  • Added output filtering

Lua Script Creation (Lines 87-135)

  • Added locale environment variables at start of heredoc

Lua Library Installation (Lines 137-174)

  • Added locale environment variables at start of heredoc
  • Added output filtering for apt-get commands

Nginx Configuration (Lines 176-389)

  • Added locale environment variables at start of heredoc

Result

The script now:

  1. Installs nginx-extras correctly (which includes Lua support)
  2. Suppresses locale warnings for cleaner output
  3. Handles package installation errors gracefully
  4. Continues with JWT configuration even if some packages have issues

Testing

After these fixes, the script should:

  • Install nginx-extras without errors about missing libnginx-mod-http-lua
  • Show minimal locale warnings (only critical errors)
  • Complete JWT authentication setup successfully

Notes

  • nginx-extras includes the Lua module, so no separate package is needed
  • Locale warnings are cosmetic and don't affect functionality
  • The script will continue even if some non-critical packages fail to install