Listen on both ipv4 and ipv6 in nginx

For environments that are dual-stack, the current config will only listen on ipv4. Adding an extra listen directive should allow connections to be served on both ipv4 & ipv6.

I couldn't figure out how to do this with a single `listen` directive. In theory, a single `[::]:5000 ipv6only=off` should work, but trying that on my local enviroment, ipv4 clients were unable to connect. A mystery.
This commit is contained in:
Andrew Rowson 2021-05-30 09:39:27 +01:00
parent 8e0c2b256e
commit 5ea5544b50

View File

@ -45,6 +45,7 @@ http {
server { server {
listen 5000; listen 5000;
listen [::]:5000;
# vod settings # vod settings
vod_base_url ''; vod_base_url '';
@ -196,7 +197,7 @@ http {
rtmp { rtmp {
server { server {
listen 1935; listen [::]:1935;
chunk_size 4096; chunk_size 4096;
allow publish 127.0.0.1; allow publish 127.0.0.1;
deny publish all; deny publish all;