Hello,
according to 
https://tomcat.apache.org/tomcat-8.0-doc/servletapi/javax/servlet/ServletRequest.html#getServerPort()
it is the Port to which the request was sent to.
Probably your Tomcat listens on Port 80 and nginx was sending the request to 
that port.

For Proxy, check out the documentation at 
https://tomcat.apache.org/tomcat-9.0-doc/config/ajp.html#Proxy_Support


Greetings,
Thomas

-----Ursprüngliche Nachricht-----
Von: 王 静凯 <ly...@outlook.com> 
Gesendet: Freitag, 21. Januar 2022 07:26
An: Tomcat Users List <users@tomcat.apache.org>
Betreff: re: getServerPort always return 80

Hi, any other know this problem? I meet it again today.
A server has an Internet IP and when nginx listen to 81,the 
request.getServerPort() return 80.


Reply via email to