为什么 nginx 会抱怨 55555 是 nginx 监听指令中的无效端口?

为什么 nginx 会抱怨 55555 是 nginx 监听指令中的无效端口?

我的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/;
           }
    }
}

感谢你的帮助。

相关内容