nginx tcp link problem
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:
1 2 | <code>Bind port 8080 error: Address already in use
</code>
|
Then netstat to see:
1 2 3 | <code> 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)
</code>
|
What I am confused about is why the situation where I am connected to myself appears?
nginx configuration:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | <code>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:
add_header cache-control "no-cache, max-age=0" ;
add_header Pragma "no-cache" ;
}
</code>
|
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
为情所困2887 days ago674