2017-03-08 11 views
0

방금 ​​DDGE WRT 펌웨어로 넷기어 R7000에 nginx를 설치했지만 다른 웹 서버의 역방향 프록시로 사용하도록 설정할 수 없습니다. 공용 IP). 0.0.0.0:80에 바인드() 실패 [emerg가] :DD-WRT의 하위 도메인에 대한 Nginx 설정

user nobody; 
worker_processes 1; 

#error_log /opt/var/log/nginx/error.log; 
#error_log /opt/var/log/nginx/error.log notice; 
#error_log /opt/var/log/nginx/error.log info; 

pid  /opt/var/run/nginx.pid; 


events { 
    worker_connections 64; 
} 


http { 
    include  mime.types; 
    default_type application/octet-stream; 
    server_names_hash_bucket_size 64; 
    #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' 
    #     '$status $body_bytes_sent "$http_referer" ' 
    #     '"$http_user_agent" "$http_x_forwarded_for"'; 

    #access_log /opt/var/log/nginx/access.log main; 

    sendfile  on; 
    #tcp_nopush  on; 

    #keepalive_timeout 0; 
    keepalive_timeout 65; 

    #gzip on; 

    server { 
     listen  80; 
     server_name localhost; 

     #charset koi8-r; 

     #access_log /opt/var/log/nginx/host.access.log; 

     location/{ 
      root /opt/share/nginx/html; 
      index index.html index.htm; 
     } 

     #error_page 404    /404.html; 

     # redirect server error pages to the static page /50x.html 
     # 
     error_page 500 502 503 504 /50x.html; 
     location = /50x.html { 
      root html; 
     } 

     # proxy the PHP scripts to Apache listening on 127.0.0.1:80 
     # 
     #location ~ \.php$ { 
     # proxy_pass http://127.0.0.1; 
     #} 

     # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 
     # 
     #location ~ \.php$ { 
     # root   html; 
     # fastcgi_pass 127.0.0.1:9000; 
     # fastcgi_index index.php; 
     # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; 
     # include  fastcgi_params; 
     #} 

     # deny access to .htaccess files, if Apache's document root 
     # concurs with nginx's one 
     # 
     #location ~ /\.ht { 
     # deny all; 
     #} 
    } 


    # another virtual host using mix of IP-, name-, and port-based configuration 
    # 
    server { 
     listen  80; 
     #listen  somename:8080; 
     server_name xxx.xxxx.it; 

     location/{ 
      proxy_pass http://192.168.x.xxx:5000; 
     } 
    } 


    # HTTPS server 
    # 
    #server { 
    # listen  443 ssl; 
    # server_name localhost; 

    # ssl_certificate  cert.pem; 
    # ssl_certificate_key cert.key; 

    # ssl_session_cache shared:SSL:1m; 
    # ssl_session_timeout 5m; 

    # ssl_ciphers HIGH:!aNULL:!MD5; 
    # ssl_prefer_server_ciphers on; 

    # location/{ 
    #  root html; 
    #  index index.html index.htm; 
    # } 
    #} 

} 

오류가

의 nginx입니다 (98 : 사용중인 주소)

는 설정이다

무엇이 잘못 되었나요?

답변

0

포트 (80)가 기본 HTTP 포트입니다 사전에 감사 그것은 가장 가능성이 DD-WRT 관리 인터페이스를 사용하고 있습니다. 역방향 프록시를 다른 포트 또는change the port DD-WRT's HTTP server listens on에 바인드해야합니다.

+0

나 한테 친절하게 제안했습니다. 이제 다른 포트에서 라우터에 연결할 수 있습니다. Nginx 서버가 작동합니다 (라우터의 IP 주소를 쓰면 환영 페이지가 나타납니다).하지만 아무 일도 일어나지 않습니다. 하위 도메인이 무엇이든 내 Nas에만 연결할 수 있습니다. – Jokerigno

+0

@ Jokerigno, 현재 nginx 구성이 nginx 환영 페이지를 제공하기 위해 se입니다. 원하지 않으실 경우 위치/{ root/opt/share/nginx/html; index index.html index.htm; } – sangnoir

+0

nginx 설정과 라우터 펌웨어를 변경했습니다. 아무것도 바뀌지 않았다. 외부에서 내 공개 IP에 연결하려고하면 nginx 환영 페이지가 표시되지 않습니다. – Jokerigno