├── .gitignore
├── images
├── 404.png
├── 418.png
├── bsod.png
├── dashboard.png
└── network-404.png
├── .editorconfig
├── nginx
├── status-pages.conf
└── catch-all.conf
├── docker-compose.yml
├── www-status-pages
├── 504.html
├── 410.html
├── 403.html
├── 404.html
├── 400.html
├── 429.html
├── 500.html
├── 401.html
├── 409.html
├── 418.html
├── 503.html
├── 405.html
├── 408.html
├── 502.html
├── 505.html
├── 412.html
├── 416.html
├── 413.html
├── 411.html
└── 407.html
├── www-catch-all
└── 404.html
├── README.md
└── LICENSE
/.gitignore:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/images/404.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Midnighter/errorpages-demo/HEAD/images/404.png
--------------------------------------------------------------------------------
/images/418.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Midnighter/errorpages-demo/HEAD/images/418.png
--------------------------------------------------------------------------------
/images/bsod.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Midnighter/errorpages-demo/HEAD/images/bsod.png
--------------------------------------------------------------------------------
/images/dashboard.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Midnighter/errorpages-demo/HEAD/images/dashboard.png
--------------------------------------------------------------------------------
/images/network-404.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Midnighter/errorpages-demo/HEAD/images/network-404.png
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | # Editor Configuration (http://editorconfig.org)
2 | root = true
3 |
4 | [*]
5 | charset = utf-8
6 | indent_style = space
7 | indent_size = 4
8 | end_of_line = lf
9 | insert_final_newline = true
10 | trim_trailing_whitespace = true
11 | max_line_length = 88
12 |
13 | [*.{json,yml,html}]
14 | indent_size = 2
15 |
16 | [*.{md,rst}]
17 | trim_trailing_whitespace = false
18 |
19 | [Makefile]
20 | indent_style = tab
21 |
--------------------------------------------------------------------------------
/nginx/status-pages.conf:
--------------------------------------------------------------------------------
1 | user nginx;
2 | worker_processes 2;
3 |
4 | events {
5 | worker_connections 1024;
6 | }
7 |
8 | http {
9 | include /etc/nginx/mime.types;
10 | default_type application/octet-stream;
11 |
12 | log_format main '$remote_addr - $remote_user [$time_local] "$request" '
13 | '$status $body_bytes_sent "$http_referer" '
14 | '"$http_user_agent" "$http_x_forwarded_for"';
15 |
16 | server {
17 | listen 80 default_server;
18 |
19 | root /usr/share/nginx/html;
20 |
21 | location / {
22 | try_files $uri =404;
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/nginx/catch-all.conf:
--------------------------------------------------------------------------------
1 | user nginx;
2 | worker_processes 2;
3 |
4 | events {
5 | worker_connections 1024;
6 | }
7 |
8 | http {
9 | include /etc/nginx/mime.types;
10 | default_type application/octet-stream;
11 |
12 | log_format main '$remote_addr - $remote_user [$time_local] "$request" '
13 | '$status $body_bytes_sent "$http_referer" '
14 | '"$http_user_agent" "$http_x_forwarded_for"';
15 |
16 | server {
17 | listen 80 default_server;
18 |
19 | root /usr/share/nginx/html;
20 |
21 | error_page 404 /404.html;
22 |
23 | location = /404.html {
24 | internal;
25 | }
26 |
27 | location / {
28 | return 404;
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/docker-compose.yml:
--------------------------------------------------------------------------------
1 | services:
2 | catch-all:
3 | image: nginx:1.21-alpine
4 | volumes:
5 | - ./nginx/catch-all.conf:/etc/nginx/nginx.conf:ro
6 | - ./www-catch-all:/usr/share/nginx/html:ro
7 | labels:
8 | - "traefik.enable=true"
9 | - "traefik.http.services.catch-all-service.loadbalancer.server.port=80"
10 | # Use as "fallback" for any unknown URL (with lowest possible priority).
11 | - "traefik.http.routers.catch-all-router.rule=HostRegexp(`{host:.+}`)"
12 | - "traefik.http.routers.catch-all-router.priority=1"
13 | - "traefik.http.routers.catch-all-router.entryPoints=web"
14 |
15 | status-pages:
16 | image: nginx:1.21-alpine
17 | volumes:
18 | - ./nginx/status-pages.conf:/etc/nginx/nginx.conf:ro
19 | - ./www-status-pages:/usr/share/nginx/html:ro
20 | labels:
21 | - "traefik.enable=true"
22 | - "traefik.http.services.status-pages-service.loadbalancer.server.port=80"
23 | - "traefik.http.routers.status-pages-router.rule=Host(`error.localhost`)"
24 | - "traefik.http.routers.status-pages-router.entryPoints=web"
25 | # Configure the error middleware for specific status codes.
26 | - "traefik.http.middlewares.status-pages-middleware.errors.status=400,401,403-405,407-413,416,418,429,500,502-505"
27 | - "traefik.http.middlewares.status-pages-middleware.errors.service=status-pages-service"
28 | - "traefik.http.middlewares.status-pages-middleware.errors.query=/{status}.html"
29 |
30 | httpbin:
31 | image: kennethreitz/httpbin:latest
32 | labels:
33 | - "traefik.enable=true"
34 | - "traefik.http.services.httpbin-service.loadbalancer.server.port=80"
35 | - "traefik.http.routers.httpbin-router.rule=Host(`test.localhost`)"
36 | - "traefik.http.routers.httpbin-router.entryPoints=web"
37 | - "traefik.http.routers.httpbin-router.middlewares=status-pages-middleware@docker"
38 |
39 | traefik:
40 | image: traefik:2.4
41 | restart: unless-stopped
42 | volumes:
43 | - /var/run/docker.sock:/var/run/docker.sock:ro
44 | ports:
45 | - target: 80
46 | published: 80
47 | mode: host
48 | command:
49 | - --accessLog=true
50 | - --api=true
51 | - --log.level=DEBUG
52 | - --entrypoints.web.address=:80
53 | - --providers.docker=true
54 | - --providers.docker.exposedByDefault=false
55 | - --providers.docker.network=default
56 | labels:
57 | - "traefik.enable=true"
58 | # Enable the Traefik dashboard.
59 | - "traefik.http.services.traefik-service.loadBalancer.server.port=8080"
60 | - "traefik.http.routers.traefik-router.rule=Host(`traefik.localhost`)"
61 | - "traefik.http.routers.traefik-router.entryPoints=web"
62 | - "traefik.http.routers.traefik-router.service=api@internal"
63 |
--------------------------------------------------------------------------------
/www-status-pages/504.html:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 | 504: Gateway Timeout
11 |
12 |
13 |
24 |
25 |
26 |
27 |
39 |
40 |
43 |
44 |
Error 504
45 |
The gateway has timed out
46 |
47 |
48 |
52 |
53 |
--------------------------------------------------------------------------------
/www-status-pages/410.html:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 | 410: Gone
11 |
12 |
13 |
24 |
25 |
26 |
27 |
39 |
40 |
43 |
44 |
Error 410
45 |
The requested page is no longer available
46 |
47 |
48 |
52 |
53 |
--------------------------------------------------------------------------------
/www-catch-all/404.html:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 | 404: Not Found
11 |
12 |
13 |
24 |
25 |
26 |
27 |
39 |
40 |
43 |
44 |
Error 404
45 |
The server can not find the requested page
46 |
47 |
48 |
52 |
53 |
--------------------------------------------------------------------------------
/www-status-pages/403.html:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 | 403: Forbidden
11 |
12 |
13 |
24 |
25 |
26 |
27 |
39 |
40 |
43 |
44 |
Error 403
45 |
Access is forbidden to the requested page
46 |
47 |
48 |
52 |
53 |
--------------------------------------------------------------------------------
/www-status-pages/404.html:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 | 404: Not Found
11 |
12 |
13 |
24 |
25 |
26 |
27 |
39 |
40 |
43 |
44 |
Error 404
45 |
The server can not find the requested page
46 |
47 |
48 |
52 |
53 |
--------------------------------------------------------------------------------
/www-status-pages/400.html:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 | 400: Bad Request
11 |
12 |
13 |
24 |
25 |
26 |
27 |
39 |
40 |
43 |
44 |
Error 400
45 |
The server did not understand the request
46 |
47 |
48 |
52 |
53 |
--------------------------------------------------------------------------------
/www-status-pages/429.html:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 | 429: Too Many Requests
11 |
12 |
13 |
24 |
25 |
26 |
27 |
39 |
40 |
43 |
44 |
Error 429
45 |
Too many requests in a given amount of time
46 |
47 |
48 |
52 |
53 |
--------------------------------------------------------------------------------
/www-status-pages/500.html:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 | 500: Internal Server Error
11 |
12 |
13 |
24 |
25 |
26 |
27 |
39 |
40 |
43 |
44 |
Error 500
45 |
The server met an unexpected condition
46 |
47 |
48 |
52 |
53 |
--------------------------------------------------------------------------------
/www-status-pages/401.html:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 | 401: Unauthorized
11 |
12 |
13 |
24 |
25 |
26 |
27 |
39 |
40 |
43 |
44 |
Error 401
45 |
The requested page needs a username and a password
46 |
47 |
48 |
52 |
53 |
--------------------------------------------------------------------------------
/www-status-pages/409.html:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 | 409: Conflict
11 |
12 |
13 |
24 |
25 |
26 |
27 |
39 |
40 |
43 |
44 |
Error 409
45 |
The request could not be completed because of a conflict
46 |
47 |
48 |
52 |
53 |
--------------------------------------------------------------------------------
/www-status-pages/418.html:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 | 418: I'm a teapot
11 |
12 |
13 |
24 |
25 |
26 |
27 |
39 |
40 |
43 |
44 |
Error 418
45 |
Attempt to brew coffee with a teapot is not supported
46 |
47 |
48 |
52 |
53 |
--------------------------------------------------------------------------------
/www-status-pages/503.html:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 | 503: Service Unavailable
11 |
12 |
13 |
24 |
25 |
26 |
27 |
39 |
40 |
43 |
44 |
Error 503
45 |
The server is temporarily overloading or down
46 |
47 |
48 |
52 |
53 |
--------------------------------------------------------------------------------
/www-status-pages/405.html:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 | 405: Method Not Allowed
11 |
12 |
13 |
24 |
25 |
26 |
27 |
39 |
40 |
43 |
44 |
Error 405
45 |
The method specified in the request is not allowed
46 |
47 |
48 |
52 |
53 |
--------------------------------------------------------------------------------
/www-status-pages/408.html:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 | 408: Request Timeout
11 |
12 |
13 |
24 |
25 |
26 |
27 |
39 |
40 |
43 |
44 |
Error 408
45 |
The request took longer than the server was prepared to wait
46 |
47 |
48 |
52 |
53 |
--------------------------------------------------------------------------------
/www-status-pages/502.html:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 | 502: Bad Gateway
11 |
12 |
13 |
24 |
25 |
26 |
27 |
39 |
40 |
43 |
44 |
Error 502
45 |
The server received an invalid response from the upstream server
46 |
47 |
48 |
52 |
53 |
--------------------------------------------------------------------------------
/www-status-pages/505.html:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 | 505: HTTP Version Not Supported
11 |
12 |
13 |
24 |
25 |
26 |
27 |
39 |
40 |
43 |
44 |
Error 505
45 |
The server does not support the "http protocol" version
46 |
47 |
48 |
52 |
53 |
--------------------------------------------------------------------------------
/www-status-pages/412.html:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 | 412: Precondition Failed
11 |
12 |
13 |
24 |
25 |
26 |
27 |
39 |
40 |
43 |
44 |
Error 412
45 |
The pre condition given in the request evaluated to false by the server
46 |
47 |
48 |
52 |
53 |
--------------------------------------------------------------------------------
/www-status-pages/416.html:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 | 416: Requested Range Not Satisfiable
11 |
12 |
13 |
24 |
25 |
26 |
27 |
39 |
40 |
43 |
44 |
Error 416
45 |
The requested byte range is not available and is out of bounds
46 |
47 |
48 |
52 |
53 |
--------------------------------------------------------------------------------
/www-status-pages/413.html:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 | 413: Payload Too Large
11 |
12 |
13 |
24 |
25 |
26 |
27 |
39 |
40 |
43 |
44 |
Error 413
45 |
The server will not accept the request, because the request entity is too large
46 |
47 |
48 |
52 |
53 |
--------------------------------------------------------------------------------
/www-status-pages/411.html:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 | 411: Length Required
11 |
12 |
13 |
24 |
25 |
26 |
27 |
39 |
40 |
43 |
44 |
Error 411
45 |
The "Content-Length" is not defined. The server will not accept the request without it
46 |
47 |
48 |
52 |
53 |
--------------------------------------------------------------------------------
/www-status-pages/407.html:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 | 407: Proxy Authentication Required
11 |
12 |
13 |
24 |
25 |
26 |
27 |
39 |
40 |
43 |
44 |
Error 407
45 |
You must authenticate with a proxy server before this request can be served
46 |
47 |
48 |
52 |
53 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Traefik Error Pages
3 | ---
4 |
5 | 
6 |
7 | ## Summary
8 |
9 | **This blog post explains in detail how to set up two traefik services and errors middleware in order to show your users a custom `404 Not Found` page on any URL unknown to traefik, as well as custom pages for any status codes that you desire on your other services.**
10 |
11 | ## Prerequisites
12 |
13 | - This post assumes some familiarity with configuring [traefik](https://doc.traefik.io/).
14 | - In order to try the examples, you will need to have installed [Docker Engine](https://docs.docker.com/engine/install/) and [Docker Compose](https://docs.docker.com/compose/install/).
15 |
16 | ## Intro
17 |
18 | At my startup [Unseen Bio](https://unseenbio.com), we recently had a need to display a more friendly page to our customers in the rare occasion that one of our services is down. We use the very enjoyable [traefik reverse proxy and load balancer](https://traefik.io/traefik/) so I took a look at the [documentation for the errors middleware](https://doc.traefik.io/traefik/middlewares/errorpages/). That gave me a good idea of what had to be done but there's nothing better than a working example, right? After a brief search I landed on three pages that got me most of the way: a [post by Andrea Mignone](https://imandrea.me/blog/traefik-custom-404/), [another by Nicholas Dille](https://dille.name/blog/2021/03/14/using-traefik-error-pages-to-handle-unavailable-services/), and a [Docker image with custom error pages with a ready-made traefik configuration](https://github.com/tarampampam/error-pages#custom-error-pages-for-traefik).
19 |
20 | Why do I say that they took me _most_ of the way? All three suggest the same basic strategy: Introduce a service that matches any [URL](https://en.wikipedia.org/wiki/URL) with a [low priority](https://doc.traefik.io/traefik/routing/routers/#priority) such that any existing service takes precedence when traefik routes a request. With Docker labels, the configuration might look as follows.
21 |
22 | ```yaml
23 | labels:
24 | - "traefik.http.routers.catch-all-router.rule=HostRegexp(`{host:.+}`)"
25 | - "traefik.http.routers.catch-all-router.priority=1"
26 | ```
27 |
28 | ## Problem
29 |
30 | The problem for us? This _catch-all_ service displays our custom page nicely but since traefik can successfully route the request, the response status is naturally `200 OK`. That means, our availability monitoring wasn't reporting outages and it triggered our engineering [OCD](https://en.wikipedia.org/wiki/Obsessive%E2%80%93compulsive_disorder).
31 |
32 | > We needed a catch-all service that always returns `404 Not Found`.
33 |
34 | ## Solution
35 |
36 | Before describing relevant parts of the configuration, I will outline the behavior of the full Docker stack [defined in the repository](https://github.com/Midnighter/errorpages-demo) accompanying this post.
37 |
38 | The [docker-compose.yml](https://github.com/Midnighter/errorpages-demo/blob/main/docker-compose.yml) defines four services:
39 |
40 | 1. A [treafik proxy](https://traefik.io/traefik/) service
41 | 2. A catch-all [nginx](https://nginx.org/) service responding with `404 Not Found`
42 | 3. Another [nginx](https://nginx.org/) service serving custom pages
43 | 4. An [httpbin](https://httpbin.org/) service to conveniently trigger abnormal responses
44 |
45 | You can run the examples by [cloning the repository](https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/cloning-a-repository-from-github/cloning-a-repository) and in the repository directory run:
46 |
47 | ```sh
48 | docker-compose up
49 | ```
50 |
51 | Traefik is configured to listen on port 80 (the default for [HTTP](https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol)) so that you can open the dashboard by visiting [traefik.localhost](http://traefik.localhost) in your favorite browser. If you [look at the HTTP routers](http://traefik.localhost/dashboard/#/http/routers), you should see a table just like below.
52 |
53 | 
54 |
55 | ### Catch-All Service
56 |
57 | If instead you visit [localhost](http://localhost/), only the catch-all service's rule will handle that and you will be greeted by a cute custom response.
58 |
59 | 
60 |
61 | Furthermore, you will see in the 'Network' tab of your browser's developer tools (which you typically open by pressing F12) that the response status is indeed a 404 and not 200\. How did we achieve that?
62 |
63 | 
64 |
65 | In order to understand this bit, we need to dive into the nginx configuration for the catch-all service. The relevant `server` entry looks as below.
66 |
67 | ```nginx
68 | server {
69 | listen 80 default_server;
70 |
71 | root /usr/share/nginx/html;
72 |
73 | error_page 404 /404.html;
74 |
75 | location = /404.html {
76 | internal;
77 | }
78 |
79 | location / {
80 | return 404;
81 | }
82 | }
83 | ```
84 |
85 | The trick is that we define an nginx error page for status 404 (located at `/usr/share/nginx/html/404.html`) and define it as `internal`. That means it is only visible to nginx itself. We then define a second location that matches any path and always returns status 404 thus always responding with the custom error page and status 404\. With this configuration we get the custom page as well as the status 404 which allows our monitoring to alert us about missing services. Success!
86 |
87 | ### Error Pages on Services
88 |
89 | For completeness, I will also show you how to configure traefik middleware in order to replace responses of a specific service with custom pages. This is useful either if it is cumbersome to customize that service's responses or if you want to configure the same customized responses on multiple services.
90 |
91 | To that end, I have created another nginx service and copied custom pages from the [Docker image that I found earlier](https://github.com/tarampampam/error-pages) into it. We then define the errors middleware via Docker labels. We could define the middleware on any service but it makes sense to associate it with the service that is queried for the custom pages.
92 |
93 | ```yaml
94 | labels:
95 | - "traefik.http.middlewares.status-pages-middleware.errors.status=400,401,403-405,407-413,416,418,429,500,502-505"
96 | - "traefik.http.middlewares.status-pages-middleware.errors.service=status-pages-service"
97 | - "traefik.http.middlewares.status-pages-middleware.errors.query=/{status}.html"
98 | ```
99 |
100 | Here, I have included all status codes for which custom pages were created. These three lines tell traefik that this middleware responds to the defined range of status codes and will query the `status-pages-service` for a path that depends on the status, for example, `/500.html`.
101 |
102 | We then enable the middleware on the httpbin service's router:
103 |
104 | ```yaml
105 | labels:
106 | - "traefik.http.routers.httpbin-router.middlewares=status-pages-middleware@docker"
107 | ```
108 |
109 | From then on, any response status from the httpbin service that is among the list of the middleware configured above, will result in the configured query. Here, traefik is in control. So even though querying for the custom page will result in a response `200 OK` (you can test this by visiting [error.localhost/400.html](http://error.localhost/400.html) and watching the 'Network' tab), traefik will replace the response status with the triggering code. You can try this with the httpbin service which lets you trigger any response status, for example, [test.localhost/status/418](http://test.localhost/status/418) (again watching the `Network` tab).
110 |
111 | 
112 |
113 | Compare this to [test.localhost/status/406](http://test.localhost/status/406) which is not handled by the middleware.
114 |
115 | ## Resources
116 |
117 | - [Demo repository for this post](https://github.com/Midnighter/errorpages-demo)
118 | - [Traefik error pages documentation](https://doc.traefik.io/traefik/middlewares/errorpages/)
119 | - Posts by:
120 |
121 | - [Andrea Mignone](https://imandrea.me/blog/traefik-custom-404/)
122 | - [Nicholas Dille](https://dille.name/blog/2021/03/14/using-traefik-error-pages-to-handle-unavailable-services/)
123 |
124 | - [Docker image with custom error pages](https://github.com/tarampampam/error-pages)
125 |
126 | ## Copyright
127 |
128 | - The code is copyright © 2021, Moritz E. Beber and shared under the permissive [Apache Software License 2.0](LICENSE).
129 | - The post itself is made available under the [Creative Commons Attribution 4.0 International License](http://creativecommons.org/licenses/by/4.0/) [](http://creativecommons.org/licenses/by/4.0/)
130 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | https://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
10 |
11 | "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
12 |
13 | "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
14 |
15 | "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
16 |
17 | "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
18 |
19 | "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
20 |
21 | "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
22 |
23 | "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
24 |
25 | "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
26 |
27 | "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
28 |
29 | 2. Grant of Copyright License.
30 |
31 | Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
32 |
33 | 3. Grant of Patent License.
34 |
35 | Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
36 |
37 | 4. Redistribution.
38 |
39 | You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
40 |
41 | You must give any other recipients of the Work or Derivative Works a copy of this License; and
42 | You must cause any modified files to carry prominent notices stating that You changed the files; and
43 | You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
44 | If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
45 |
46 | You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
47 |
48 | 5. Submission of Contributions.
49 |
50 | Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
51 |
52 | 6. Trademarks.
53 |
54 | This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
55 |
56 | 7. Disclaimer of Warranty.
57 |
58 | Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
59 |
60 | 8. Limitation of Liability.
61 |
62 | In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
63 |
64 | 9. Accepting Warranty or Additional Liability.
65 |
66 | While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
67 |
68 | END OF TERMS AND CONDITIONS
69 |
--------------------------------------------------------------------------------