進階搜尋
搜尋結果
找到了 578 個結果
【錯誤處理】【Nginx】client intended to send too large body
查了一下資料發現造成的原因為 web server 接收 request body 的大小設定 apache:LimitRequestBody 預設為 0(unlimit) nginx:client_max_body_size 預設為 1m 根據以下步驟更改一下 nginx 設定,就沒問題了 http { ... # set request body size unlimit client_max_body_size 0; ... } nginx -s re...
Vagrant 相關
https://developer.hashicorp.com/vagrant/downloads
【Lua】ngx.say 與 ngx.print 差異
差異在 ngx.say 會加入一個換行符號
【Fiddler】玩轉 Fiddler-HTTP(s) 抓包能手
玩轉 Fiddler-HTTP(s) 抓包能手 & 常見「特殊」用途 https://ryanlee.tw/2021/08/23/fiddler/
【Mac】清除dns快取
MACOS VERSION COMMAND macOS 12 (Monterey) sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder macOS 11 (Big Sur) sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder macOS 10.15 (Catalina) sudo dscacheutil -flushcache; sudo kill...
【Git】windows系統 warning: LF will be replaced by CRLF in
windows系統下使用git出現:warning: LF will be replaced by CRLF in $ git add readme.txt readme.txt warning: LF will be replaced by CRLF in learngit/readme.txt. The file will have its original line endings in your working directory 原因是windows系統的換行符和Unix下的換行符不同,但是git...
【Lua】SSL相關指令執行順序
【Lua】ngx_lua_module
指令 說明 set_by_lua* 流程分支處理判斷變量初始化 rewrite_by_lua* 轉發、重定向、緩存等功能 access_by_lua* IP 准入、身份驗證、接口權限、解密 content_by_lua* 內容生成 header_filter_by_lua* 響應頭部過濾處理,可以添加響應頭 body_filter_by_lua* 響應體過濾處理,例如轉換響應體 log_by_lua* 異步完成日誌記錄,日誌可以記錄在本地,還可以同步到其他機器 ...
【Lua】Nginx 變量
使用Ng變量 要在OpenResty中引用Nginx變量,可以使用 ngx . var . VARIABLE,要將變量從字符串轉換為數字,可以使用 tonumber函數。 -- 黑名单 local black_ips = {["127.0.0.1"]=true} -- 当前客户端IP local ip = ngx.var.remote_addr if true == black_ips[ip] then -- 返回相应的HTTP状态码 ngx.exit(ngx.HTTP_FOR...
【Lua】安裝 luarocks
https://github.com/luarocks/luarocks/wiki/Download https://github.com/luarocks/luarocks/wiki/Installation-instructions-for-Unix apt-get update apt install build-essential libreadline-dev unzip wget zlib1g-dev -y #安裝 luarocks wget https://luarocks.org...
畫面投放至Mac
安裝 brew install scrcpy brew install --cask android-platform-tools 手機 開啟usb偵錯 mac 呼叫 scrcpy 使用chrome 偵錯webview url: chrome://inspect/#devices 手機開至網頁,點選 inspect 疑難排解 如果電腦還是找不到裝置,或是指出裝置未經授權:請拔除 USB 傳輸線,然後在裝置上依序輕觸「設定」>「開發人員選項」>「撤銷 USB 偵錯授權...
【Lua】vscode 外掛
https://marketplace.visualstudio.com/items?itemName=sumneko.lua
【Lua】【型別】 字串- 數字
nil boolean number string function userdata thread table Number( 數字) 字串轉數字 tonumber("1.0") 數字轉字串 tostring(1.0) 自動轉型 -- Lua會自動轉型,如果一個字串與數字相加,會嘗試將字串轉換為數字 "1.0" + 2 -- => 3.0 -- 如果一個數字和字串使用串接,會嘗試將數字轉換成字串: "1.0"..2 -- => 1.02 -- 數字轉字串 1.0 .. "...
【Lua】【型別】 函數function
函數宣告 函數可以使用function來做宣告,並以end結束 function hello() print("Hello, World") end -- 等同以下 hello = function() print("Hello, World") end function genFun() return function() print("Hello, World") end end function callFun(f) f() end ...
【Lua】【型別】 nil - 布林
nil nil是Lua裡的一個特殊值,代表什麼也沒有。其型別也是nil type(nil) -- => nil 布林 布林值只有true和false 只要不是nil或是false都為真, 包含0、空表、空字串 。 if 0 then print("0 is true") end if {} then print("{} is true") end if "" then print [["" is true]] end ~= 不等於 weeks = {"週一","週...
【Lua】註解
單行註解 -- 這是註解 多行註解 -- 使用 --[[ 內文 ]]-- 包起來 --[[ function log_header_body() -- 取出列表編號 local t = cjson.decode(ngx.req.get_body_data()) local body = cjson.encode(t) ngx.log(ngx.ERR, body) local headers = cjson...
【Lua】【流程控制】if
if true then print("if block") elseif true then print("elseif block") else print("else") end if not true then print("not true") else print("else") end elseif 中間沒有空白要注意 if true then print("if block") else if true then print("els...
【Lua】【流程控制】for
-- for i = {起始值}, {結束值}, {step] do for i = 1, 10, 2 do print(i) end -- 1 -- 3 -- 5 -- 7 -- 9 迭代 array = {"one", "two", "three"} for i, v in ipairs(array) do print(i, v) end -- 1 one -- 2 two -- 3 three array = {"one", "two", "...