![为什么 nginx 会抱怨 55555 是 nginx 监听指令中的无效端口?](https://linux22.com/image/715253/%E4%B8%BA%E4%BB%80%E4%B9%88%20nginx%20%E4%BC%9A%E6%8A%B1%E6%80%A8%2055555%20%E6%98%AF%20nginx%20%E7%9B%91%E5%90%AC%E6%8C%87%E4%BB%A4%E4%B8%AD%E7%9A%84%E6%97%A0%E6%95%88%E7%AB%AF%E5%8F%A3%EF%BC%9F.png)
我的nginx v1.6.2
配置与监听192.168.128.105:55555
工作正常。
我正在尝试验证相同的配置nginx v1.10.3
,但出现了以下错误,
nginx:[emerg] invalid port in "192.168.128.105:55555" of the "listen" directive in ...nginx.conf:39
看了看nginx 监听文档但我找不到有关此错误的任何信息。編輯-1以下是 nginx.conf
user www-data;
worker_processes auto; #v1.10.3 - error 1 is invalid number
error_log /var/log/nginx/error.log debug;
pid /var/run/nginx.pid;
events {
#worker_connections 1024; #v1.10.3 - error 1024 is invalid number
}
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
#keepalive_timeout 65; #v1.10.3 - error 65 is invalid value
#types_hash_max_size 2048; #v1.10.3 - error 2048 is invalid number
include /etc/nginx/mime.types;
default_type application/octet-stream;
##
# Gzip Settings
##
gzip on;
gzip_disable "msie6";
#gzip off;
#gzip_proxied off;
#chunked_transfer_encoding off;
server {
listen 192.168.128.105:55555;
server_name 192.168.128.105:55555;
location / {
proxy_buffering off;
proxy_set_header Host $http_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-For '$http_x_forwarded_for, $realip_remote_addr';
proxy_set_header X-Forwarded-Proto http;
proxy_pass http://192.168.3.2/;
}
}
}
感谢你的帮助。