nginx-sid/debian/tests/lua
Christos Trochalakis e60711fcc7 tests: Fix race between reload and curl's http request
Restart nginx to make sure it uses the new configuration.
2017-08-29 11:05:37 +03:00

18 lines
327 B
Bash

#!/bin/bash
set -e
rm /etc/nginx/sites-enabled/default
cat <<EOF > "/etc/nginx/sites-enabled/lua"
server {
listen 80 default_server;
location /ping {
content_by_lua 'ngx.say("PONG")';
}
}
EOF
nginx -t
invoke-rc.d nginx restart
curl --silent --fail -o /dev/null -w "response_code: %{http_code}\n" http://127.0.0.1/ping