Merge pull request #3819 from dokku/3805-bind-address
Allow binding nginx to specific IPv4/IPv6 interfaces
This commit is contained in:
@@ -107,6 +107,55 @@ assert_error_log() {
|
||||
assert_failure
|
||||
}
|
||||
|
||||
@test "(nginx-vhosts) nginx:set bind-address" {
|
||||
run deploy_app
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku nginx:set $TEST_APP bind-address-ipv4 127.0.0.1"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku nginx:set $TEST_APP bind-address-ipv6 ::1"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku nginx:build-config $TEST_APP"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku nginx:show-conf $TEST_APP"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_output_contains "[::1]:80;"
|
||||
assert_output_contains "127.0.0.1:80;"
|
||||
|
||||
run /bin/bash -c "dokku nginx:set $TEST_APP bind-address-ipv4"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku nginx:set $TEST_APP bind-address-ipv6"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku nginx:build-config $TEST_APP"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku nginx:show-conf $TEST_APP"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_output_contains "[::1]:80;" 0
|
||||
assert_output_contains "127.0.0.1:80;" 0
|
||||
}
|
||||
|
||||
@test "(nginx-vhosts) nginx:validate" {
|
||||
deploy_app
|
||||
run /bin/bash -c "dokku nginx:validate"
|
||||
|
||||
Reference in New Issue
Block a user