source: installer/resources/eepsite/contexts/base-context.xml @ e7c2162

Last change on this file since e7c2162 was e7c2162, checked in by zzz <zzz@…>, 2 years ago

i2ptunnel: Strip server Date header
More efficient header checks
Jetty config tweaks

  • Property mode set to 100644
File size: 2.7 KB
Line 
1<?xml version="1.0"  encoding="ISO-8859-1"?>
2<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
3
4<!--
5Configure a custom context for the eepsite.
6
7This context contains only a ServletContextHandler with a default servlet
8to serve static html files and images.
9-->
10
11<Configure class="org.eclipse.jetty.servlet.ServletContextHandler">
12  <Set name="contextPath">/</Set>
13  <Set name="resourceBase">./eepsite/docroot/</Set>
14  <Call name="setInitParameter">
15    <Arg>org.eclipse.jetty.servlet.Default.cacheControl</Arg>
16    <Arg>max-age=3600,public</Arg>
17  </Call>
18  <!-- change to true to allow directory listings -->
19  <Call name="setInitParameter">
20    <Arg>org.eclipse.jetty.servlet.Default.dirAllowed</Arg>
21    <Arg>false</Arg>
22  </Call>
23  <Call name="setMimeTypes">
24    <Arg>
25      <New class="org.eclipse.jetty.http.MimeTypes">
26        <Call name="addMimeMapping">
27          <Arg>sud</Arg>
28          <Arg>application/zip</Arg>
29        </Call>
30        <Call name="addMimeMapping">
31          <Arg>su2</Arg>
32          <Arg>application/zip</Arg>
33        </Call>
34        <Call name="addMimeMapping">
35          <Arg>xpi2p</Arg>
36          <Arg>application/zip</Arg>
37        </Call>
38      </New>
39    </Arg>
40  </Call>
41  <Call name="addServlet">
42    <Arg>net.i2p.servlet.I2PDefaultServlet</Arg>
43    <Arg>/</Arg>
44  </Call>
45  <Call name="addFilter">
46    <!-- Add a filter to gzip on-the fly, since if we don't do it, I2P will.
47      -  This lowers the resource usage in the Java process on the client side,
48      -  by pushing the decompression out of Java and into the browser.
49      -  For all the reasons noted in the GzipFilter javadocs, this is normally
50      -  a bad idea for static content, but this is I2P.
51      -  See I2PTunnelHTTPServer for the I2P compressor.
52      -->
53    <Arg>
54      <New class="org.eclipse.jetty.servlet.FilterHolder" >
55        <Arg>
56          <New class="org.eclipse.jetty.servlets.GzipFilter" />
57        </Arg>
58        <Call name="setInitParameter">
59          <!-- minimum in Java is 1300 -->
60          <Arg>minGzipSize</Arg>
61          <Arg>512</Arg>
62        </Call>
63        <Call name="setInitParameter">
64          <!-- In Java we have a blacklist. This covers the most common cases. -->
65          <Arg>mimeTypes</Arg>
66          <Arg>application/pdf,application/x-javascript,application/xhtml+xml,application/xml,image/svg+xml,text/css,text/html,text/plain</Arg>
67        </Call>
68      </New>
69    </Arg>
70    <Arg>/*</Arg>
71    <Arg>
72      <!-- just guessing here -->
73      <Call class="java.util.EnumSet" name="of" >
74        <Arg>
75          <Call class="javax.servlet.DispatcherType" name="valueOf" >
76            <Arg>REQUEST</Arg>
77          </Call>
78        </Arg>
79      </Call>
80    </Arg>
81  </Call>
82</Configure>
83
Note: See TracBrowser for help on using the repository browser.