Re: 回复: getServerPort always return 80

2022-01-06 Thread Hua Zhang
Hi Wang, A second application (nginx) is involved here. The problem can be related to nginx, nginx received a http traffic on 10001 in access log does not mean that if forwards exactly the same original http request. Probably some configuration needs to be changed there. You should take a look in

Re: 回复: getServerPort always return 80

2022-01-06 Thread Hua Zhang
Hi Wang, I hope that this link will help you to solve the problem: https://stackoverflow.com/questions/19751313/forward-request-headers-from-nginx-proxy-server You may check the tomcat access log to see what kind of traffic it received from nginx to confirm that your issue is related to nginx

回复: 回复: getServerPort always return 80

2022-01-06 Thread 王 静凯
Hi Hua, You are right, when tomcat listening port 80, then getServerPort return 10001. So how to resolve this problem when I use nginx as a reverse-proxy? I write in nginx config file: “proxy_set_header Host$http_host;” or “proxy_set_header Host

Re: Jdbc drivers not found on Tomcat 10

2022-01-06 Thread Christopher Schultz
Hantsy, On 1/5/22 23:31, hantsy bai wrote: I finally resolved this issue. Exclude the pg driver from war, and copy it to tomcat/lib, it works. I remember in the past years, I preferred tomcat for Java Web applications because I did not need to register a Jdbc driver but it is tedious work in

Re: How do I allow CORS from any domain but only specific ports?

2022-01-06 Thread Christopher Schultz
Blake, On 1/6/22 10:29, Blake McBride wrote: Greetings, I have been using the following with success: CorsFilter org.apache.catalina.filters.CorsFilter cors.allowed.headers

How do I allow CORS from any domain but only specific ports?

2022-01-06 Thread Blake McBride
Greetings, I have been using the following with success: CorsFilter org.apache.catalina.filters.CorsFilter cors.allowed.headers

RE: How to do a catch-all Host?

2022-01-06 Thread Neil Aggarwal
Chris: I figured out the problem. I put quotes around the secret in workers.properties since I had copied and pasted it from server.xml. I removed them and everything worked. Thanks for your help! Thank you, Neil -- Neil Aggarwal, (972) 834-1565, http://www.propfinancing.com We offer 30

Re: How do I allow CORS from any domain but only specific ports?

2022-01-06 Thread Blake McBride
Thanks, Christopher. I think, for now, I'll just use * when developing and turned off when in production. I wonder if changing that method to protected might be a potential security hole. Thanks! Blake McBride On Thu, Jan 6, 2022 at 10:34 AM Christopher Schultz <

Re: How do I allow CORS from any domain but only specific ports?

2022-01-06 Thread Blake McBride
On Thu, Jan 6, 2022 at 3:42 PM Christopher Schultz < ch...@christopherschultz.net> wrote: > Blake, > > On 1/6/22 16:17, Blake McBride wrote: > > I think, for now, I'll just use * when developing and turned off when in > > production. > > What's the point of that? The entire purpose of CORS is to

Re: How do I allow CORS from any domain but only specific ports?

2022-01-06 Thread Christopher Schultz
Blake, On 1/6/22 16:17, Blake McBride wrote: I think, for now, I'll just use * when developing and turned off when in production. What's the point of that? The entire purpose of CORS is to protect users from attackers while allowing legitimate uses of your own resources. Running it in

Re: How do I allow CORS from any domain but only specific ports?

2022-01-06 Thread Blake McBride
Thanks for the input!! --blake On Thu, Jan 6, 2022 at 4:36 PM Christopher Schultz < ch...@christopherschultz.net> wrote: > Blake, > > On 1/6/22 17:08, Blake McBride wrote: > > On Thu, Jan 6, 2022 at 3:42 PM Christopher Schultz < > > ch...@christopherschultz.net> wrote: > > > >> Blake, > >> > >>

Re: How do I allow CORS from any domain but only specific ports?

2022-01-06 Thread Christopher Schultz
Blake, On 1/6/22 17:08, Blake McBride wrote: On Thu, Jan 6, 2022 at 3:42 PM Christopher Schultz < ch...@christopherschultz.net> wrote: Blake, On 1/6/22 16:17, Blake McBride wrote: I think, for now, I'll just use * when developing and turned off when in production. What's the point of

Re: Jdbc drivers not found on Tomcat 10

2022-01-06 Thread hantsy bai
HI Christopher, not sure we are on the same page. The problem I encountered was that a Spring 6 war app with pg driver(42.3.1) could not deploy on Tomcat 10, but worked well when downupgraded to Spring 5/Tomcat 9. But on the jetty 11 and WildFly preview 26, Spring 6/pg war package are also