Skip to content

Commit

Permalink
Use uWSGI in HTTP mode instead of socket
Browse files Browse the repository at this point in the history
This prevents an issue with mod_scgi that turns requests to /xxx into /xxx/
  • Loading branch information
rgaudin committed Jan 3, 2024
1 parent 1391f80 commit be44410
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
10 changes: 3 additions & 7 deletions captive-portal/lighttpd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,10 @@ $SERVER["socket"] == ":2443" {
ssl.privkey = "/etc/ssl/captive.key"
}

server.modules += ( "mod_scgi" )
scgi.protocol = "uwsgi"

# we want everything but /assets/* to go through uWSGI
server.modules += ( "mod_proxy" )
$HTTP["url"] !~ "^/assets/" {
scgi.server = (
"" => (( "socket" => "/var/run/uwsgi.sock", "check-local" => "disable" )),
)
proxy.server = ( "" => ( ( "host" => "127.0.0.1", "port" => "3000" ) ) )
proxy.header = ( "upgrade" => "enable" )
}

alias.url = ( "/assets/" => "/src/portal/assets" )
3 changes: 2 additions & 1 deletion captive-portal/uwsgi.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ autoload = false
# to command netfilter and conntrack

home = /usr/local/captive-env
uwsgi-socket= /var/run/uwsgi.sock
plugin = http
http-socket = :3000
workdir = /src
wsgi-file = /src/entrypoint.py
# important to keep a single process
Expand Down

0 comments on commit be44410

Please sign in to comment.