Skip to content

Crash for unknown reason #27

@ethernidee

Description

@ethernidee

The following simple .htaccess file produces 500 error:

## No directory listings
Options -Indexes

<IfModule autoindex>
  IndexIgnore *
</IfModule>

RewriteEngine On
RewriteBase /

## Begin - Rewrite rules to block out some common exploits ##
RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR]
RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
RewriteRule .* index.php [F]
## End - Rewrite rules to block out some common exploits ##

# Remove trailing backslash from URIs
RewriteCond %{REQUEST_METHOD} =GET
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)\/$ $1 [R=301,L]

## Begin - Core SEF Section ##
#RewriteRule ^ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteCond %{REQUEST_URI} !^/index\.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [L]
## End - Core SEF Section ##

Error:

*211 lua entry thread aborted: runtime error: /etc/nginx/lua/htaccess.lua:796: bad argument #2 to 'gsub' (string/function/table expected)
stack traceback:
coroutine 0:
  [C]: in function 'gsub'
  /etc/nginx/lua/htaccess.lua:796: in function 'replace_server_vars'
  /etc/nginx/lua/htaccess.lua:1060: in function </etc/nginx/lua/htaccess.lua:1>, client: 0.0.0.0, server: test.com, request: "POST /api/receive-signals HTTP/1.1", host: "test.com"
2023/01/31 04:30:31 [error] 766145#766145: *212 lua entry thread aborted: runtime error: /etc/nginx/lua/htaccess.lua:796: bad argument #2 to 'gsub' (string/function/table expected)
stack traceback:
coroutine 0:
  [C]: in function 'gsub'
  /etc/nginx/lua/htaccess.lua:796: in function 'replace_server_vars'
  /etc/nginx/lua/htaccess.lua:1060: in function </etc/nginx/lua/htaccess.lua:1>, client: 0.0.0.0, server: test.com, request: "GET /admin/panel HTTP/2.0", host: "test.com", referrer: "https://test.com/admin/login"
2023/01/31 04:30:33 [error] 766145#766145: *212 lua entry thread aborted: runtime error: /etc/nginx/lua/htaccess.lua:796: bad argument #2 to 'gsub' (string/function/table expected)
stack traceback:
coroutine 0:
  [C]: in function 'gsub'
  /etc/nginx/lua/htaccess.lua:796: in function 'replace_server_vars'
  /etc/nginx/lua/htaccess.lua:1060: in function </etc/nginx/lua/htaccess.lua:1>, client: 0.0.0.0, server: test.com, request: "GET /favicon.ico HTTP/2.0", host: "test.com", referrer: "https://test.com/admin/panel"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions