Нужно прослушать диапазон портов 16384-32768.
Код выглядит так:
server {
listen 192.168.1.4:80;
listen 192.168.1.4:16384-32768;
server_name domen.com;
location / {
proxy_pass
http://192.168.1.11:$server_port;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
Ошибка service nginx restart:
-- Результат: failed.
апр 20 11:43:16 192.168.1.4 systemd[1]: Unit nginx.service entered failed state.
апр 20 11:43:16 192.168.1.4 systemd[1]: nginx.service failed.
lines 1513-1535/1535 (END)
апр 20 11:43:16 192.168.1.4 dhclient[3924]: send_packet: Operation not permitted
апр 20 11:43:16 192.168.1.4 kernel: Firewall: *UDP_OUT Blocked* IN= OUT=eth0 SRC=192.168.1.4 DST=192.168.1.1 LEN=328 TOS=0x00
апр 20 11:43:16 192.168.1.4 dhclient[3924]: dhclient.c:2688: Failed to send 300 byte long packet over fallback interface.
апр 20 11:43:16 192.168.1.4 systemd[1]: Cannot add dependency job for unit rpcbind.socket, ignoring: Unit not found.
апр 20 11:43:16 192.168.1.4 systemd[1]: Starting The nginx HTTP and reverse proxy server...
-- Subject: Начинается запуск юнита nginx.service
-- Defined-By: systemd
-- Support:
lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Начат процесс запуска юнита nginx.service.
апр 20 11:43:16 192.168.1.4 nginx[25095]: nginx: [emerg] invalid port in "192.168.1.4:16384-32768" of the "listen" directive
апр 20 11:43:16 192.168.1.4 nginx[25095]: nginx: configuration file /etc/nginx/nginx.conf test failed
апр 20 11:43:16 192.168.1.4 systemd[1]: nginx.service: control process exited, code=exited status=1
апр 20 11:43:16 192.168.1.4 systemd[1]: Failed to start The nginx HTTP and reverse proxy server.
-- Subject: Ошибка юнита nginx.service
-- Defined-By: systemd
-- Support:
lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Произошел сбой юнита nginx.service.