Skip to content

Commit

Permalink
Updated nginx files
Browse files Browse the repository at this point in the history
  • Loading branch information
wmantly committed Aug 9, 2024
1 parent 0a0f7d8 commit 92df055
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 10 deletions.
8 changes: 3 additions & 5 deletions ops/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,9 @@ sudo apt-get update

sudo apt-get -y install openresty


sudo luarocks install lua-resty-auto-ssl
sudo luarocks install lua-resty-socket
sudo luarocks install lua-socket
sudo luarocks install socket
sudo luarocks install luasocket
sudo luarocks install luasocket-unix
sudo luarocks install lua-cjson

mkdir /etc/ssl/

Expand All @@ -50,5 +46,7 @@ git clone https://github.com/theta42/proxy.git
cd proxy/nodejs
npm install

ln -s ops/nginx_conf/targetinfo.lua /usr/local/openresty/lualib/

systemctl start proxy.service
systemctl enable proxy.service
1 change: 0 additions & 1 deletion ops/nginx_conf/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ http {
local targetInfo = require "targetinfo"

auto_ssl:set("allow_domain", function(domain)
ngx.log(ngx.ERR, "!!!!!!!!!! allow_domain ", ngx.ctx.toAllow)
return ngx.ctx.toAllow
end)

Expand Down
2 changes: 0 additions & 2 deletions ops/nginx_conf/proxy.conf
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ server {
local scheme = ngx.var.scheme
local res = targetInfo.get(ngx, host, ngx.ctx.targetInfo)

ngx.log(ngx.ERR, "!!!!!!!!! after getTargetInfo proxy.conf ", res["ip"])

if scheme == "http" then
if res["forcessl"] == "true" then
return ngx.redirect("https://"..host..uri, 301)
Expand Down
2 changes: 0 additions & 2 deletions ops/nginx_conf/targetinfo.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ print("In targetInfo module")

-- Main function of the module
function M.get(ngx, domain, targetInfo)
ngx.log(ngx.ERR, "!!!!!!!!! in targetInfo get")
if targetInfo then
return targetInfo
end
Expand All @@ -22,7 +21,6 @@ function M.get(ngx, domain, targetInfo)
local redis = require "resty.redis"

if not domain then
ngx.log(ngx.ERR, "no host header found")
ngx.exit(499)
return false
end
Expand Down

0 comments on commit 92df055

Please sign in to comment.