openresty / openresty/openresty.org

openresty see .css/.js as lua file

Open
#25 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
1.3k
Forks
293
Avg merge
2d 20h
Merged PRs (30d)
2

Description

Hi. Lua module tries to enterpretate all css/js files as lua fies.

*95 failed to load external Lua file "/usr/local/openresty/nginx/html/mysite/themes/default/js/jquery-1.10.2.min.js":

My config

location ~^/mysite/(.+) {
default_type text/html;
lua_need_request_body on;
lua_code_cache off;
content_by_lua_file html/mysite/$1;
index index.lua index.lp;
}
location ~* ^.+.(?:css|eot|js|json|png|svg|ttf|woff)$ { }

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the provided nginx location blocks, especially content_by_lua_file and the static-file location, and reproduce how the jquery-1.10.2.min.js request is routed. Trace which location handles that request and verify that CSS and JavaScript assets are no longer passed to Lua while Lua files still work.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua, nginx
Domain
backend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.