diff options
author | nodiscc <nodiscc@gmail.com> | 2020-05-16 12:54:51 +0200 |
---|---|---|
committer | nodiscc <nodiscc@gmail.com> | 2020-09-12 14:31:45 +0200 |
commit | 91a21c272960889afd4eaa431a3d29b7785b6efc (patch) | |
tree | 26e3ba62319964c5fd48d93fdfe47813d5dc9bf5 /doc/md/docker/reverse-proxy-configuration.md | |
parent | 6128ab6a55430a2b705be31ff417c0c552a0db1f (diff) | |
download | Shaarli-91a21c272960889afd4eaa431a3d29b7785b6efc.tar.gz Shaarli-91a21c272960889afd4eaa431a3d29b7785b6efc.tar.zst Shaarli-91a21c272960889afd4eaa431a3d29b7785b6efc.zip |
**General rewording, proof-reading, deduplication, shortening, reordering, simplification, cleanup/formatting/standardization**
- standardize page names, rework documentation structure, update TOC
- use same example paths everywhere
- level 1 titles on all pages
- fix broken links
- .md suffix on all page links (works both from readthedocs and github repository views)
**Server:**
A full and concise installation guide with examples is a frequent request. The documentation should provide such a guide for basic installation needs, while explaining alternative/advanced configuration at the end. Links to reference guides and documentation should be used more frequently to avoid recommending an outdated or excessively complex configuration.
- server: move most server-related info to server-configuration.md, cleanup/shorten
- server: update list of php dependencies/libraries, link to composer.json
- server: installation: support 3 install methods (from release zip, from sources, using docker)
- server: installation: use rsync instead of mv as mv results will change depending of taget directory already existing or not
- server: add example/basic usage of certbot
- server, upgrade, installation: update file permissions setup, use sudo for upgrade operations in webserver document root
- server: apache: add comments to configuration, fix and factorize file permissions setup, set cache-control header, deny access to dotfiles, add missing apache config steps, add http->https redirect example
- server: nginx: refactor nginx configuration, add comments, DO log access to denied/protected files
- server: add links to MDN for x-forwarded-* http headers explanation, cleanup/clarify robots.txt and crawlers section
- server: bump file upload size limit to 100MB we have reports of bookmark exports weighing +40MB - i have a 13MB one here
- server: simplify phpinfo documentation
- server: move backup and restore information to dedicated page
- docker: move all docker docs to Docker.md, simplify/ docker setup, add docker-compose.yml example, replace docker-101 with docker cheatsheet
- troubleshooting: move all troubleshooting documentation to troubleshooting.md
**Usage:**
- index: add getting started section on index page
- features/usage: move all usage-related documentation to usage.md, add links from the main feature list to corresponding usage docs, clarify/reword features list
- shaarli configuration: add note about configuring from web interface
**Removed:**
- remove obsolete/orphan images
- remove obsolete shaarchiver example
- remove outdated "decode datastore content" snippet
**Development:**
- development: move development-related docs (static analysis, CI, unit tests, 3rd party libs, link structure/directory, guidelines, security....) to dev/ directory
- development: Merge several pages to development.md
- **Breaking change?:** remove mentions of 'stable' branch, switch to new branch/release model (master=latest commit, release=latest tag)
- **Breaking change?:** refer to base sharing unit as "Shaare" everywhere (TODO: reflect changes in the code?) doc: update featues list/link to usage.md for details
- development: directory structure: add note about required file permissions
- .travis-ci.yml: add comments
- .htaccess: add comment
Diffstat (limited to 'doc/md/docker/reverse-proxy-configuration.md')
-rw-r--r-- | doc/md/docker/reverse-proxy-configuration.md | 123 |
1 files changed, 0 insertions, 123 deletions
diff --git a/doc/md/docker/reverse-proxy-configuration.md b/doc/md/docker/reverse-proxy-configuration.md deleted file mode 100644 index e53c9422..00000000 --- a/doc/md/docker/reverse-proxy-configuration.md +++ /dev/null | |||
@@ -1,123 +0,0 @@ | |||
1 | ## Foreword | ||
2 | |||
3 | This guide assumes that: | ||
4 | |||
5 | - Shaarli runs in a Docker container | ||
6 | - The host's `10080` port is mapped to the container's `80` port | ||
7 | - Shaarli's Fully Qualified Domain Name (FQDN) is `shaarli.domain.tld` | ||
8 | - HTTP traffic is redirected to HTTPS | ||
9 | |||
10 | ## Apache | ||
11 | |||
12 | - [Apache 2.4 documentation](https://httpd.apache.org/docs/2.4/) | ||
13 | - [mod_proxy](https://httpd.apache.org/docs/2.4/mod/mod_proxy.html) | ||
14 | - [Reverse Proxy Request Headers](https://httpd.apache.org/docs/2.4/mod/mod_proxy.html#x-headers) | ||
15 | |||
16 | The following HTTP headers are set when the `ProxyPass` directive is set: | ||
17 | |||
18 | - `X-Forwarded-For` | ||
19 | - `X-Forwarded-Host` | ||
20 | - `X-Forwarded-Server` | ||
21 | |||
22 | The original `SERVER_NAME` can be sent to the proxied host by setting the [`ProxyPreserveHost`](https://httpd.apache.org/docs/2.4/mod/mod_proxy.html#ProxyPreserveHost) directive to `On`. | ||
23 | |||
24 | ```apache | ||
25 | <VirtualHost *:80> | ||
26 | ServerName shaarli.domain.tld | ||
27 | Redirect permanent / https://shaarli.domain.tld | ||
28 | </VirtualHost> | ||
29 | |||
30 | <VirtualHost *:443> | ||
31 | ServerName shaarli.domain.tld | ||
32 | |||
33 | SSLEngine on | ||
34 | SSLCertificateFile /path/to/cert | ||
35 | SSLCertificateKeyFile /path/to/certkey | ||
36 | |||
37 | LogLevel warn | ||
38 | ErrorLog /var/log/apache2/shaarli-error.log | ||
39 | CustomLog /var/log/apache2/shaarli-access.log combined | ||
40 | |||
41 | RequestHeader set X-Forwarded-Proto "https" | ||
42 | ProxyPreserveHost On | ||
43 | |||
44 | ProxyPass / http://127.0.0.1:10080/ | ||
45 | ProxyPassReverse / http://127.0.0.1:10080/ | ||
46 | </VirtualHost> | ||
47 | ``` | ||
48 | |||
49 | |||
50 | ## HAProxy | ||
51 | |||
52 | - [HAProxy documentation](https://cbonte.github.io/haproxy-dconv/) | ||
53 | |||
54 | ```conf | ||
55 | global | ||
56 | [...] | ||
57 | |||
58 | defaults | ||
59 | [...] | ||
60 | |||
61 | frontend http-in | ||
62 | bind :80 | ||
63 | redirect scheme https code 301 if !{ ssl_fc } | ||
64 | |||
65 | bind :443 ssl crt /path/to/cert.pem | ||
66 | |||
67 | default_backend shaarli | ||
68 | |||
69 | |||
70 | backend shaarli | ||
71 | mode http | ||
72 | option http-server-close | ||
73 | option forwardfor | ||
74 | reqadd X-Forwarded-Proto: https | ||
75 | |||
76 | server shaarli1 127.0.0.1:10080 | ||
77 | ``` | ||
78 | |||
79 | |||
80 | ## Nginx | ||
81 | |||
82 | - [Nginx documentation](https://nginx.org/en/docs/) | ||
83 | |||
84 | ```nginx | ||
85 | http { | ||
86 | [...] | ||
87 | |||
88 | index index.html index.php; | ||
89 | |||
90 | root /home/john/web; | ||
91 | access_log /var/log/nginx/access.log; | ||
92 | error_log /var/log/nginx/error.log; | ||
93 | |||
94 | server { | ||
95 | listen 80; | ||
96 | server_name shaarli.domain.tld; | ||
97 | return 301 https://shaarli.domain.tld$request_uri; | ||
98 | } | ||
99 | |||
100 | server { | ||
101 | listen 443 ssl http2; | ||
102 | server_name shaarli.domain.tld; | ||
103 | |||
104 | ssl_certificate /path/to/cert | ||
105 | ssl_certificate_key /path/to/certkey | ||
106 | |||
107 | location / { | ||
108 | proxy_set_header X-Real-IP $remote_addr; | ||
109 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
110 | proxy_set_header X-Forwarded-Proto $scheme; | ||
111 | proxy_set_header X-Forwarded-Host $host; | ||
112 | |||
113 | proxy_pass http://localhost:10080/; | ||
114 | proxy_set_header Host $host; | ||
115 | proxy_connect_timeout 30s; | ||
116 | proxy_read_timeout 120s; | ||
117 | |||
118 | access_log /var/log/nginx/shaarli.access.log; | ||
119 | error_log /var/log/nginx/shaarli.error.log; | ||
120 | } | ||
121 | } | ||
122 | } | ||
123 | ``` | ||