|
| 1 | +// [START pagespeed_example] |
| 2 | +<pagespeed> |
| 3 | + <domain-to-rewrite>*.cdn.myapp.com</domain-to-rewrite> |
| 4 | + <domain-to-rewrite>www.flickr.com</domain-to-rewrite> |
| 5 | + <url-blacklist>http://*/*.svg</url-blacklist> |
| 6 | + <url-blacklist>http://secure.foo.com/*</url-blacklist> |
| 7 | + <enabled-rewriter>CollapseWhitespace</enabled-rewriter> |
| 8 | + <disabled-rewriter>CombineJs</disabled-rewriter> |
| 9 | + <disabled-rewriter>ProxyImages</disabled-rewriter> |
| 10 | +</pagespeed> |
| 11 | +</appengine-web-app> |
| 12 | +// [END pagespeed_example] |
| 13 | + |
| 14 | +// [START custom_error_example] |
| 15 | +<static-error-handlers> |
| 16 | + <handler file="default_error.html" /> |
| 17 | + <handler file="over_quota.html" error-code="over_quota" /> |
| 18 | +</static-error-handlers> |
| 19 | +// [END custom_error_example] |
| 20 | + |
| 21 | +// [START expiration_example] |
| 22 | +<static-files> |
| 23 | + <include path="/**.png" expiration="4d 5h" /> |
| 24 | +</static-files> |
| 25 | +// [END expiration_example] |
| 26 | + |
| 27 | +// [START expiration_example_yaml] |
| 28 | +static_files: |
| 29 | +- include: /**.png |
| 30 | +expiration: 4d 5h |
| 31 | +// [END expiration_example_yaml] |
| 32 | + |
| 33 | +// [START static_codesample_xml] |
| 34 | +<static-files> |
| 35 | + <include path="/**.png" /> |
| 36 | + <exclude path="/data/**.png" /> |
| 37 | + // [END static_codesample_xml] |
| 38 | + |
| 39 | + // [START static_codesample_yaml] |
| 40 | + static_files: |
| 41 | + - include: /**.png |
| 42 | + - exclude: /data/**.png |
| 43 | + // [END static_codesample_yaml] |
| 44 | + |
| 45 | + // [START resource_codesample_xml] |
| 46 | + <resource-files> |
| 47 | + <include path="/**.xml" /> |
| 48 | + <exclude path="/feeds/**.xml" /> |
| 49 | + // [END resource_codesample_xml] |
| 50 | + |
| 51 | + // [START resource_codesample_yaml] |
| 52 | + resource_files: |
| 53 | + - include: /**.xml |
| 54 | + - exclude: /feeds/**.xml |
| 55 | + // [END resource_codesample_yaml] |
| 56 | + |
| 57 | + //[START header_codesample_xml] |
| 58 | + <static-files> |
| 59 | + <include path="/my_static-files" > |
| 60 | + <http-header name="Access-Control-Allow-Origin" value="http://example.org" /> |
| 61 | + </include> |
| 62 | + </static-files> |
| 63 | + //[END header_codesample_xml] |
| 64 | + |
| 65 | + //[START header_codesample_yaml] |
| 66 | + static_files: |
| 67 | + - include: /static/* |
| 68 | + http_headers: |
| 69 | + Access-Control-Allow-Origin: http://example.org |
| 70 | + //[END header_codesample_yaml] |
| 71 | + |
| 72 | + //[START mapper_codesample_yaml] |
| 73 | + handlers: |
| 74 | + - url: /red/* |
| 75 | + servlet: mysite.server.TeamServlet |
| 76 | + init_params: |
| 77 | + teamColor: red |
| 78 | + bgColor: "#CC0000" |
| 79 | + name: redteam |
| 80 | + - url: /blue/* |
| 81 | + servlet: mysite.server.TeamServlet |
| 82 | + init_params: |
| 83 | + teamColor: blue |
| 84 | + bgColor: "#0000CC" |
| 85 | + name: blueteam |
| 86 | + - url: /register/* |
| 87 | + jsp: /register/start.jsp |
| 88 | + - url: /*.special |
| 89 | + filter: mysite.server.LogFilterImpl |
| 90 | + init_params: |
| 91 | + logType: special |
| 92 | + //[END mapper_codesample_yaml] |
| 93 | + |
| 94 | + //[START environment_variables] |
| 95 | + <system-properties> |
| 96 | + <property name="myapp.maximum-message-length" value="140" /> |
| 97 | + <property name="myapp.notify-every-n-signups" value="1000" /> |
| 98 | + <property name="myapp.notify-url" value="http://www.example.com/signupnotify" /> |
| 99 | + </system-properties> |
| 100 | + |
| 101 | + <env-variables> |
| 102 | + <env-var name="DEFAULT_ENCODING" value="UTF-8" /> |
| 103 | + </env-variables> |
| 104 | + //[END environment_variables] |
| 105 | + |
| 106 | + //[START environment_variables_yaml] |
| 107 | + system_properties: |
| 108 | + myapp.maximum-message-length: 140 |
| 109 | + myapp.notify-every-n-signups: 1000 |
| 110 | + myapp.notify-url: http://www.example.com/signupnotify |
| 111 | + env_variables: |
| 112 | + DEFAULT_ENCODING: UTF-8 |
| 113 | + context_params: |
| 114 | + rack.env: production |
| 115 | + //[END environment_variables_yaml] |
| 116 | + |
| 117 | + //[START inbound_services] |
| 118 | + <inbound-services> |
| 119 | + <service>mail</service> |
| 120 | + <service>warmup</service> |
| 121 | + </inbound-services> |
| 122 | + //[END inbound_services] |
| 123 | + |
| 124 | + //[START admin_console_custom_pages] |
| 125 | + <admin-console> |
| 126 | + <page name="Blog Comment Admin" url="/blog/admin/comments" /> |
| 127 | + <page name="Create a Blog Post" url="/blog/admin/newentry" /> |
| 128 | + </admin-console> |
| 129 | + //[END admin_console_custom_pages] |
| 130 | + |
| 131 | + //[START about_app_yaml_example] |
| 132 | + application: myapp |
| 133 | + version: alpha-001 |
| 134 | + runtime: java |
| 135 | + api_version: 1 |
| 136 | + |
| 137 | + handlers: |
| 138 | + - url: /admin/* |
| 139 | + login: admin |
| 140 | + //[END about_app_yaml_example] |
| 141 | + |
| 142 | + //[START minimal_appengine_web_xml] |
| 143 | + <?xml version="1.0" encoding="utf-8"?> |
| 144 | + <appengine-web-app xmlns="http://appengine.google.com/ns/1.0"> |
| 145 | + <application>_your_app_id_</application> |
| 146 | + <version>alpha-001</version> |
| 147 | + <threadsafe>true</threadsafe> |
| 148 | + </appengine-web-app> |
| 149 | + //[END minimal_appengine_web_xml] |
| 150 | + |
| 151 | + //[START secure_handler_yaml] |
| 152 | + handlers: |
| 153 | + |
| 154 | + - url: /youraccount/* |
| 155 | + login: required |
| 156 | + secure: always |
| 157 | + //[END secure_handler_yaml] |
| 158 | + |
| 159 | + //[START servlet_listeners] |
| 160 | + listeners: |
| 161 | + - com.example.MyListener |
| 162 | + - com.example.MyOtherListener |
| 163 | + //[END servlet_listeners] |
| 164 | + |
| 165 | + //[START login_example_yaml] |
| 166 | + handlers: |
| 167 | + |
| 168 | + - url: /profile/* |
| 169 | + login: required |
| 170 | + |
| 171 | + - url: /admin/* |
| 172 | + servlet: com.example.AdminServlet |
| 173 | + login: admin |
| 174 | + //[END login_example_yaml] |
| 175 | + |
| 176 | + //[START welcome_files] |
| 177 | + welcome_files: |
| 178 | + - index.jsp |
| 179 | + - index.html |
| 180 | + //[END welcome_files] |
| 181 | + |
| 182 | + //[START load_on_startup] |
| 183 | + <servlet> |
| 184 | + <servlet-name>my-servlet</servlet-name> |
| 185 | + <servlet-class>com.company.MyServlet</servlet-class> |
| 186 | + <load-on-startup>1</load-on-startup> |
| 187 | + </servlet> |
| 188 | + //[END load_on_startup] |
| 189 | + |
| 190 | + //[START ServletContextListener] |
| 191 | + <listener> |
| 192 | + <listener-class>com.company.MyListener</listener-class> |
| 193 | + </listener> |
| 194 | + //[END ServletContextListener] |
| 195 | + |
| 196 | + //[START listener_filter] |
| 197 | + public class MyListener implements ServletContextListener { |
| 198 | + public void contextInitialized(ServletContextEvent event) { |
| 199 | + // This will be invoked as part of a warmup request, or the first user |
| 200 | + // request if no warmup request was invoked. |
| 201 | + } |
| 202 | + public void contextDestroyed(ServletContextEvent event) { |
| 203 | + // App Engine does not currently invoke this method. |
| 204 | + } |
| 205 | + } |
| 206 | + //[END listener_filter] |
| 207 | + |
| 208 | + //[START custom_warmup_servlet] |
| 209 | + <servlet> |
| 210 | + <servlet-name>_ah_warmup</servlet-name> |
| 211 | + <servlet-class>com.company.MyWarmupServlet</servlet-class> |
| 212 | + //[END custom_warmup_servlet] |
| 213 | + |
| 214 | + //[START warmup_yaml] |
| 215 | + inbound_services: |
| 216 | + - xmpp_message |
| 217 | + - mail |
| 218 | + //[END warmup_yaml] |
| 219 | + |
| 220 | + //[START custom_xml_output] |
| 221 | + web_xml: | |
| 222 | + <error-page> |
| 223 | + <error-code>500</error-code> |
| 224 | + <location>/errors/servererror.jsp</location> |
| 225 | + </error-page> |
| 226 | + //[END custom_xml_output] |
0 commit comments