"Fossies" - the Fresh Open Source Software Archive

Member "solr-8.4.1/solr/server/etc/jetty.xml" (10 Jan 2020, 11950 Bytes) of package /linux/www/solr-8.4.1-src.tgz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) XML source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "jetty.xml": 8.4.0_vs_8.4.1.

    1 <?xml version="1.0"?>
    2 <!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd">
    3 
    4 <!-- =============================================================== -->
    5 <!-- Configure the Jetty Server                                      -->
    6 <!--                                                                 -->
    7 <!-- Documentation of this file format can be found at:              -->
    8 <!-- http://wiki.eclipse.org/Jetty/Reference/jetty.xml_syntax        -->
    9 <!--                                                                 -->
   10 <!-- =============================================================== -->
   11 
   12 
   13 <Configure id="Server" class="org.eclipse.jetty.server.Server">
   14 
   15   <!-- =========================================================== -->
   16   <!-- Configure the Server Thread Pool.                           -->
   17   <!-- The server holds a common thread pool which is used by      -->
   18   <!-- default as the executor used by all connectors and servlet  -->
   19   <!-- dispatches.                                                 -->
   20   <!--                                                             -->
   21   <!-- Configuring a fixed thread pool is vital to controlling the -->
   22   <!-- maximal memory footprint of the server and is a key tuning  -->
   23   <!-- parameter for tuning.  In an application that rarely blocks -->
   24   <!-- then maximal threads may be close to the number of 5*CPUs.  -->
   25   <!-- In an application that frequently blocks, then maximal      -->
   26   <!-- threads should be set as high as possible given the memory  -->
   27   <!-- available.                                                  -->
   28   <!--                                                             -->
   29   <!-- Consult the javadoc of o.e.j.util.thread.QueuedThreadPool   -->
   30   <!-- for all configuration that may be set here.                 -->
   31   <!-- =========================================================== -->
   32   <Arg name="threadpool">
   33     <New id="threadpool" class="com.codahale.metrics.jetty9.InstrumentedQueuedThreadPool">
   34       <Arg name="registry">
   35         <Call id="solrJettyMetricRegistry" name="getOrCreate" class="com.codahale.metrics.SharedMetricRegistries">
   36           <Arg>solr.jetty</Arg>
   37         </Call>
   38       </Arg>
   39     </New>
   40   </Arg>
   41 
   42   <Get name="ThreadPool">
   43     <Set name="minThreads" type="int"><Property name="solr.jetty.threads.min" default="10"/></Set>
   44     <Set name="maxThreads" type="int"><Property name="solr.jetty.threads.max" default="10000"/></Set>
   45     <Set name="idleTimeout" type="int"><Property name="solr.jetty.threads.idle.timeout" default="120000"/></Set>
   46     <Set name="stopTimeout" type="int"><Property name="solr.jetty.threads.stop.timeout" default="60000"/></Set>
   47     <Set name="detailedDump">false</Set>
   48   </Get>
   49 
   50 
   51   <!-- =========================================================== -->
   52   <!-- Http Configuration.                                         -->
   53   <!-- This is a common configuration instance used by all         -->
   54   <!-- connectors that can carry HTTP semantics (HTTP, HTTPS, SPDY)-->
   55   <!-- It configures the non wire protocol aspects of the HTTP     -->
   56   <!-- semantic.                                                   -->
   57   <!--                                                             -->
   58   <!-- This configuration is only defined here and is used by      -->
   59   <!-- reference from the jetty-http.xml, jetty-https.xml and      -->
   60   <!-- jetty-spdy.xml configuration files which instantiate the    -->
   61   <!-- connectors.                                                 -->
   62   <!--                                                             -->
   63   <!-- Consult the javadoc of o.e.j.server.HttpConfiguration       -->
   64   <!-- for all configuration that may be set here.                 -->
   65   <!-- =========================================================== -->
   66   <New id="httpConfig" class="org.eclipse.jetty.server.HttpConfiguration">
   67     <Set name="secureScheme">https</Set>
   68     <Set name="securePort"><Property name="solr.jetty.secure.port" default="8443" /></Set>
   69     <Set name="outputBufferSize"><Property name="solr.jetty.output.buffer.size" default="32768" /></Set>
   70     <Set name="outputAggregationSize"><Property name="solr.jetty.output.aggregation.size" default="8192" /></Set>
   71     <Set name="requestHeaderSize"><Property name="solr.jetty.request.header.size" default="8192" /></Set>
   72     <Set name="responseHeaderSize"><Property name="solr.jetty.response.header.size" default="8192" /></Set>
   73     <Set name="sendServerVersion"><Property name="solr.jetty.send.server.version" default="false" /></Set>
   74     <Set name="sendDateHeader"><Property name="solr.jetty.send.date.header" default="false" /></Set>
   75     <Set name="headerCacheSize"><Property name="solr.jetty.header.cache.size" default="512" /></Set>
   76     <Set name="delayDispatchUntilContent"><Property name="solr.jetty.delayDispatchUntilContent" default="false"/></Set>
   77     <!-- Uncomment to enable handling of X-Forwarded- style headers
   78     <Call name="addCustomizer">
   79       <Arg><New class="org.eclipse.jetty.server.ForwardedRequestCustomizer"/></Arg>
   80     </Call>
   81     -->
   82   </New>
   83 
   84     <!-- =========================================================== -->
   85     <!-- RewriteHandle to set headers, redirect root to Solr         -->
   86     <!-- =========================================================== -->
   87      <New id="RewriteHandler" class="org.eclipse.jetty.rewrite.handler.RewriteHandler">
   88       <Set name="rewriteRequestURI">true</Set>
   89       <Set name="rewritePathInfo">false</Set>
   90       <Set name="originalPathAttribute">requestedPath</Set>
   91 
   92       <!-- security-related headers -->
   93       <Call name="addRule">
   94         <Arg>
   95           <New class="org.eclipse.jetty.rewrite.handler.HeaderPatternRule">
   96             <Set name="pattern">*</Set>
   97             <Set name="name">Content-Security-Policy</Set>
   98             <Set name="value">default-src 'none'; base-uri 'none'; connect-src 'self'; form-action 'self'; font-src 'self'; frame-ancestors 'none'; img-src 'self'; media-src 'self'; style-src 'self' 'unsafe-inline'; script-src 'self'; worker-src 'self';</Set>
   99           </New>
  100         </Arg>
  101       </Call>
  102       <Call name="addRule">
  103         <Arg>
  104           <New class="org.eclipse.jetty.rewrite.handler.HeaderPatternRule">
  105             <Set name="pattern">*</Set>
  106             <Set name="name">X-Content-Type-Options</Set>
  107             <Set name="value">nosniff</Set>
  108           </New>
  109         </Arg>
  110       </Call>
  111       <Call name="addRule">
  112         <Arg>
  113           <New class="org.eclipse.jetty.rewrite.handler.HeaderPatternRule">
  114             <Set name="pattern">*</Set>
  115             <Set name="name">X-Frame-Options</Set>
  116             <Set name="value">SAMEORIGIN</Set>
  117           </New>
  118         </Arg>
  119       </Call>
  120       <Call name="addRule">
  121         <Arg>
  122           <New class="org.eclipse.jetty.rewrite.handler.HeaderPatternRule">
  123             <Set name="pattern">*</Set>
  124             <Set name="name">X-XSS-Protection</Set>
  125             <Set name="value">1; mode=block</Set>
  126           </New>
  127         </Arg>
  128       </Call>
  129 
  130       <!-- redirect root to solr -->
  131       <Call name="addRule">
  132         <Arg>
  133           <New class="org.eclipse.jetty.rewrite.handler.RedirectRegexRule">
  134             <Set name="regex">^/$</Set>
  135             <Set name="location">/solr/</Set>
  136           </New>
  137         </Arg>
  138       </Call>
  139        <Call name="addRule">
  140          <Arg>
  141            <New class="org.eclipse.jetty.rewrite.handler.RewritePatternRule">
  142              <Set name="pattern">/v2/*</Set>
  143              <Set name="replacement">/solr/____v2</Set>
  144            </New>
  145          </Arg>
  146        </Call>
  147        <Call name="addRule">
  148          <Arg>
  149            <New class="org.eclipse.jetty.rewrite.handler.RewritePatternRule">
  150              <Set name="pattern">/api/*</Set>
  151              <Set name="replacement">/solr/____v2</Set>
  152            </New>
  153          </Arg>
  154        </Call>
  155        <Set name="handler">
  156          <New id="Handlers" class="org.eclipse.jetty.server.handler.HandlerCollection">
  157            <Set name="handlers">
  158              <Array type="org.eclipse.jetty.server.Handler">
  159                <Item>
  160                  <New id="Contexts" class="org.eclipse.jetty.server.handler.ContextHandlerCollection"/>
  161                </Item>
  162                <Item>
  163                  <New id="InstrumentedHandler" class="com.codahale.metrics.jetty9.InstrumentedHandler">
  164                    <Arg><Ref refid="solrJettyMetricRegistry"/></Arg>
  165                    <Set name="handler">
  166                      <New id="DefaultHandler" class="org.eclipse.jetty.server.handler.DefaultHandler"/>
  167                    </Set>
  168                  </New>
  169                </Item>
  170                <Item>
  171                  <New id="RequestLog" class="org.eclipse.jetty.server.handler.RequestLogHandler"/>
  172                </Item>
  173              </Array>
  174            </Set>
  175          </New>
  176        </Set>
  177      </New>
  178 
  179     <!-- =========================================================== -->
  180     <!-- Set handler Collection Structure                            -->
  181     <!-- =========================================================== -->
  182     <Set name="handler">
  183       <Ref id="RewriteHandler"/>
  184     </Set>
  185     
  186     <!-- =========================================================== -->
  187     <!-- Configure Request Log                                       -->
  188     <!-- =========================================================== -->
  189     <!--
  190     <Ref id="Handlers">
  191       <Call name="addHandler">
  192         <Arg>
  193           <New id="RequestLog" class="org.eclipse.jetty.server.handler.RequestLogHandler">
  194             <Set name="requestLog">
  195               <New id="RequestLogImpl" class="org.eclipse.jetty.server.NCSARequestLog">
  196                 <Set name="filename">
  197                    logs/request.yyyy_mm_dd.log
  198                 </Set>
  199                 <Set name="filenameDateFormat">yyyy_MM_dd</Set>
  200                 <Set name="retainDays">90</Set>
  201                 <Set name="append">true</Set>
  202                 <Set name="extended">false</Set>
  203                 <Set name="logCookies">false</Set>
  204                 <Set name="LogTimeZone">UTC</Set>
  205               </New>
  206             </Set>
  207           </New>
  208         </Arg>
  209       </Call>
  210     </Ref>
  211     -->
  212 
  213     <!-- =========================================================== -->
  214     <!-- extra options                                               -->
  215     <!-- =========================================================== -->
  216     <Set name="stopAtShutdown">true</Set>
  217     <Set name="dumpAfterStart">false</Set>
  218     <Set name="dumpBeforeStop">false</Set>
  219 
  220     <Call name="addBean">
  221       <Arg>
  222         <New id="DeploymentManager" class="org.eclipse.jetty.deploy.DeploymentManager">
  223           <Set name="contexts">
  224             <Ref refid="Contexts" />
  225           </Set>
  226           <Call name="setContextAttribute">
  227             <Arg>org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern</Arg>
  228             <Arg>.*/servlet-api-[^/]*\.jar$</Arg>
  229           </Call>
  230 
  231           <Call name="addAppProvider">
  232             <Arg>
  233               <New class="org.eclipse.jetty.deploy.providers.WebAppProvider">
  234                 <Set name="monitoredDirName"><Property name="jetty.base" default="."/>/contexts</Set>
  235                 <Set name="scanInterval">0</Set>
  236               </New>
  237             </Arg>
  238           </Call>
  239           
  240           <!-- Add a customize step to the deployment lifecycle -->
  241           <!-- uncomment and replace DebugBinding with your extended AppLifeCycle.Binding class 
  242           <Call name="insertLifeCycleNode">
  243             <Arg>deployed</Arg>
  244             <Arg>starting</Arg>
  245             <Arg>customise</Arg>
  246           </Call>
  247           <Call name="addLifeCycleBinding">
  248             <Arg>
  249               <New class="org.eclipse.jetty.deploy.bindings.DebugBinding">
  250                 <Arg>customise</Arg>
  251               </New>
  252             </Arg>
  253           </Call>
  254           -->
  255           
  256         </New>
  257       </Arg>
  258     </Call>
  259     
  260 </Configure>