nginx tcp link problem
为情所困
为情所困 2017-05-16 17:26:09
0
2
545

1. Currently, my nginx configuration is started on port 80, and then I have a background service started on port 8080
I use nginx as a reverse proxy. The background service will start automatically after it hangs up. The problem I am currently encountering is that after the background service hangs up, an error will be reported when it starts up again:

Bind port 8080 error: Address already in use

Then netstat to see:

 sudo netstat -anpto |grep 127.0.0.1
tcp        0      0 127.0.0.1:8080              127.0.0.1:8080              ESTABLISHED 3841/nginx          off (0.00/0/0)

What I am confused about is why the situation where I am connected to myself appears?

nginx configuration:

upstream test.com{
    server 127.0.0.1:8080;
}

server
  {
    listen       80;
    server_name  test.com;
    index index.html index.htm index.php;



    location / {
        proxy_pass http://test.com;
        add_header cache-control "no-cache, max-age=0";
        add_header Pragma "no-cache";
    }

Relevant information:

  • http://in.sdo.com/?p=3044
  • http://blog.csdn.net/kofshower/article/details/5316580
  • https://realaboo.wordpress.com/2009/12/28/interesting-single-port-self-connection-phenomenon/
  • http://blog.csdn.net/justlinux2010/article/details/20947609
为情所困
为情所困

reply all(2)
曾经蜡笔没有小新

Come and read this article, it should be the same situation

PHPzhong

The one upstairs is the correct answer

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!