PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, June 25, 2022

[FIXED] Why Jetty asks for ProxyTo, when I have provided one

 June 25, 2022     embedded-jetty, java, reverse-proxy     No comments   

Issue

I have code for starting a web app in Jetty. I want to add reverse proxy handling inside the app. When I call API,

I get error UnavailableException: Init parameter 'proxyTo' is required.

Server server = new Server(port);

WebAppContext webapp = createWebAppContext();

ServletHolder proxyServlet = new ServletHolder(ProxyServlet.Transparent.class);
proxyServlet.setInitParameter("ProxyTo", "http://attachments.dev.balcia.com:30310/api/");
proxyServlet.setInitParameter("Prefix", "/api");
webapp.addServlet(proxyServlet, "/api/attachments/*");

server.setHandler(webapp);

Solution

The init-parameter is called proxyTo not ProxyTo.

Servlet init-parameters are case sensitive.



Answered By - Joakim Erdfelt
Answer Checked By - Dawn Plyler (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing