# Proxy\_pass with / in the end causes SYN packets?

**URL:** <https://community.nginx.org/t/proxy-pass-with-in-the-end-causes-syn-packets/421>\
**Category:** NGINX\
**Tags:** openresty, packets, reverse-proxy\
**Created:** [February 14, 2025, 5:18am UTC](https://community.nginx.org/t/proxy-pass-with-in-the-end-causes-syn-packets/421 "2025-02-14T05:18:47Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![yasoo7964](https://drob5swvtjqxg.cloudfront.net/user_avatar/community.nginx.org/yasoo7964/32/307_2.png) [@yasoo7964](https://community.nginx.org/u/yasoo7964)\
**Post date:** [February 14, 2025, 5:18am UTC](https://community.nginx.org/t/proxy-pass-with-in-the-end-causes-syn-packets/421/1 "2025-02-14T05:18:47Z")

</div>

Hi, now i’m making Reverse Proxy by using Nginx1.25.3(openresty1.25.3.1),  
i have one backend  
backend1:192.168.62.60

that has no content\_path so i set up nginx.conf like below.  
and i wanna have other backends so give it a location keyword in the request uri as “/backend1”,  
and call proxy\_pass with / in the end(remove “/backend1” from request\_uri).

then when i was looking into the packets between Nginx and backend1 with WireShark,  
i’ve noticed that SYN packets are increased than when i connected directly from browser to backend1.

heard many suggestions that Keep-Alive may be involved, so i tried the parameters related to it, but there was no change.

In the WireShark view,  
Connection parameter in the sent HTTP request, are always set as “Keep-Alive”,  
but Nginx always sends FIN,ACK packet at the end of each tcp sequence started by one HTTP request from it’s side.

Any suggestion, please.  
Thanks in advance.

Best regards. Yasoo7964

---- nginx.conf ---------

```auto
http {
  upstream backend1_server {
    server 192.168.62.60;
    keepalive 32;
  }
  server {
    listen 80;
    
    listen 443 ssl;
    ssl_certificate /etc/ssl/rootCA/gw.com/certs/gw.com.crt.pem;
    ssl_password_file /etc/ssl/rootCA/gw.com/pwf;
    ssl_certificate_key /etc/ssl/rootCA/gw.com/private/privkey.pem;
    
    server_name 192.168.52.111;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "Keep-Alive";
    proxy_set_header Host $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-Proto $scheme;
    
    keepalive_timeout 60s;
    keepalive_requests 100;
    proxy_connect_timeout 5s;
    proxy_read_timeout 60s;
    
    proxy_max_temp_file_size 0;
    sendfile off;
    etag off;
    if_modified_since off;
    
    location /backend1/ {
      proxy_pass http://backend1_server/;
      proxy_redirect / /backend1/;
      
      header_filter_by_lua_block {
        rewrite_resp.header_filter()
      }
      body_filter_by_lua_block {
        rewrite_resp.body_filter(ngx.var.scheme, ngx.var.server_name, "backend1")
      }
    }
  }
}
```

---

<div class="post-metadata">

**Author:** ![s.miller](https://drob5swvtjqxg.cloudfront.net/user_avatar/community.nginx.org/s.miller/32/39_2.png) [@s.miller](https://community.nginx.org/u/s.miller)\
**Post date:** [February 14, 2025, 5:21am UTC](https://community.nginx.org/t/proxy-pass-with-in-the-end-causes-syn-packets/421/2 "2025-02-14T05:21:08Z")

</div>

Moved this to the Troubleshooting category.

---

<div class="post-metadata">

**Author:** ![yasoo7964](https://drob5swvtjqxg.cloudfront.net/user_avatar/community.nginx.org/yasoo7964/32/307_2.png) [@yasoo7964](https://community.nginx.org/u/yasoo7964)\
**Post date:** [February 14, 2025, 8:50am UTC](https://community.nginx.org/t/proxy-pass-with-in-the-end-causes-syn-packets/421/3 "2025-02-14T08:50:01Z")

</div>

Note: I asked this question because GPT said, ``Adding / to the end of proxy\_pass, in other words, rewriting the HTTP request, may increase the number of SYN packets.‘’

---

<div class="post-metadata">

**Author:** ![yasoo7964](https://drob5swvtjqxg.cloudfront.net/user_avatar/community.nginx.org/yasoo7964/32/307_2.png) [@yasoo7964](https://community.nginx.org/u/yasoo7964)\
**Post date:** [February 18, 2025, 6:07am UTC](https://community.nginx.org/t/proxy-pass-with-in-the-end-causes-syn-packets/421/4 "2025-02-18T06:07:29Z")

</div>

with further investigation, i found that backend1 does not support HTTP/1.1, so even though Nginx sends HTTP/1.1 request, backend1 always reply “HTTP/1.0 200 OK”.  
In HTTP/1.0, it is correct behavior to create a new socket for each request.  
sorry for asking an irrelevant question.

On the other hand, when i directly connect to backend1 with Edge,  
Edge does not send FIN,ACK even when it receives “HTTP/1.0 200 OK”, and reuses the socket.

so i look into the “HTTP/1.0 200 OK”, it attached “Connection:Keep-Alive” option.  
and i’ve heard that even in HTTP/1.0, it can reuse the socket with the option.

Does Nginx not support it?

---

<div class="post-metadata">

**Author:** ![Damian\_Curry](https://avatars.discourse-cdn.com/v4/letter/d/94ad74/32.png) [@Damian\_Curry](https://community.nginx.org/u/Damian_Curry)\
**Post date:** [February 18, 2025, 7:52pm UTC](https://community.nginx.org/t/proxy-pass-with-in-the-end-causes-syn-packets/421/5 "2025-02-18T19:52:19Z")

</div>

If you upstream service does not support HTTP/1.1, you should remove the `proxy_http_version 1.1;` from your configuration, as this is setting communication for the upstream to use version 1.1. Without this directive, nginx will default to using HTTP/1 when proxying traffic to the upstream.

---

<div class="post-metadata">

**Author:** ![yasoo7964](https://drob5swvtjqxg.cloudfront.net/user_avatar/community.nginx.org/yasoo7964/32/307_2.png) [@yasoo7964](https://community.nginx.org/u/yasoo7964)\
**Post date:** [February 19, 2025, 12:38am UTC](https://community.nginx.org/t/proxy-pass-with-in-the-end-causes-syn-packets/421/6 "2025-02-19T00:38:29Z")

</div>

Thank you Damian,

i’ve tried it so Nginx sends GET xxxx HTTP/1.0 with Connection:Keep-Alive,  
and then upstream replies as HTTP/1.0 200 OK with Connection:Keep-Alive,  
but Nginx replies with FIN,ACK to it.

627 12.026094427 192.168.62.111 192.168.62.60 TCP 74 0 51946 → 80 [SYN] Seq=0 Win=64240 Len=0 MSS=1460 SACK\_PERM=1 TSval=1540337777 TSecr=0 WS=128  
628 12.027588129 192.168.62.60 192.168.62.111 TCP 62 0 80 → 51946 [SYN, ACK] Seq=0 Ack=1 Win=14600 Len=0 MSS=1460 SACK\_PERM=1  
629 12.027961381 192.168.62.111 192.168.62.60 TCP 54 1 51946 → 80 [ACK] Seq=1 Ack=1 Win=64240 Len=0  
630 12.029281992 192.168.62.111 192.168.62.60 HTTP 792 1 GET /date.htm HTTP/1.0

```
GET /date.htm HTTP/1.0\r\n
Connection: Keep-Alive\r\n

```

631 12.030395246 192.168.62.60 192.168.62.111 TCP 60 1 80 → 51946 [ACK] Seq=1 Ack=739 Win=15498 Len=0  
632 12.030633835 192.168.62.60 192.168.62.111 TCP 238 1 80 → 51946 [PSH, ACK] Seq=1 Ack=739 Win=15498 Len=184 [TCP segment of a reassembled PDU]  
633 12.030667413 192.168.62.111 192.168.62.60 TCP 54 739 51946 → 80 [ACK] Seq=739 Ack=185 Win=64056 Len=0  
634 12.030814113 192.168.62.60 192.168.62.111 HTTP 1292 185 HTTP/1.0 200 OK (text/html)

```
HTTP/1.0 200 OK\r\n
Connection: Keep-Alive\r\n

```

635 12.030824244 192.168.62.111 192.168.62.60 TCP 54 739 51946 → 80 [ACK] Seq=739 Ack=1423 Win=64056 Len=0  
636 12.030895231 192.168.62.111 192.168.62.60 TCP 54 739 51946 → 80 [FIN, ACK] Seq=739 Ack=1423 Win=64056 Len=0  
637 12.031795309 192.168.62.60 192.168.62.111 TCP 60 1423 80 → 51946 [FIN, ACK] Seq=1423 Ack=740 Win=15498 Len=0  
638 12.031829625 192.168.62.111 192.168.62.60 TCP 54 740 51946 → 80 [ACK] Seq=740 Ack=1424 Win=64056 Len=0

---

<div class="post-metadata">

**Author:** ![alessandro](https://drob5swvtjqxg.cloudfront.net/user_avatar/community.nginx.org/alessandro/32/4836_2.png) [@alessandro](https://community.nginx.org/u/alessandro)\
**Post date:** [June 23, 2025, 1:16pm UTC](https://community.nginx.org/t/proxy-pass-with-in-the-end-causes-syn-packets/421/7 "2025-06-23T13:16:08Z")

</div>

Hey @yasoo7964. Where you able to figure this out in the end?

---

<div class="post-metadata">

**Author:** ![system](https://drob5swvtjqxg.cloudfront.net/user_avatar/community.nginx.org/system/32/19_2.png) [@system](https://community.nginx.org/u/system)\
**Post date:** [July 23, 2025, 1:16pm UTC](https://community.nginx.org/t/proxy-pass-with-in-the-end-causes-syn-packets/421/8 "2025-07-23T13:16:15Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
