Fossil SCM
Added HTTP proxying info to Debian nginx server setup guide.
Commit
c6a033cea66f8c0208bb53d15bd39eea05906fc82b216a5eea0faf3b8022cf23
Parent
a4bb92f7916caff…
1 file changed
+29
-5
+29
-5
| --- www/server/debian/nginx.md | ||
| +++ www/server/debian/nginx.md | ||
| @@ -66,15 +66,15 @@ | ||
| 66 | 66 | |
| 67 | 67 | Fossil provides four major ways to access a repository it’s serving |
| 68 | 68 | remotely, three of which are straightforward to use with nginx: |
| 69 | 69 | |
| 70 | 70 | * **HTTP** — Fossil has a built-in HTTP server: [`fossil |
| 71 | - server`](/help/server). While this method is efficient and it’s | |
| 72 | - possible to use nginx to proxy access to another HTTP server, this | |
| 73 | - option is overkill for our purposes. nginx is itself a fully | |
| 74 | - featured HTTP server, so we will choose in this guide not to make | |
| 75 | - nginx reinterpret Fossil’s implementation of HTTP. | |
| 71 | + server`](../any/none.md). While this method is efficient and it’s | |
| 72 | + possible to use nginx to proxy access to another HTTP server, we | |
| 73 | + don’t see any particularly good reason to make nginx reinterpret | |
| 74 | + Fossil’s own implementation of HTTP when we have a better option. | |
| 75 | + (But see [below](#http).) | |
| 76 | 76 | |
| 77 | 77 | * **CGI** — This method is simple but inefficient, because it launches |
| 78 | 78 | a separate Fossil instance on every HTTP hit. |
| 79 | 79 | |
| 80 | 80 | Since Fossil is a relatively small self-contained program, and it’s |
| @@ -196,6 +196,30 @@ | ||
| 196 | 196 | |
| 197 | 197 | The configuration for `foo.net` is similar. |
| 198 | 198 | |
| 199 | 199 | See [the nginx docs](http://nginx.org/en/docs/) for more ideas. |
| 200 | 200 | |
| 201 | + | |
| 202 | +## <a name="http"></a>Proxying HTTP Anyway | |
| 203 | + | |
| 204 | +[Above](#modes), we argued that proxying SCGI is a better option than | |
| 205 | +making nginx reinterpret Fossil’s own implementation of HTTP. If you | |
| 206 | +want Fossil to speak HTTP, just [set Fossil up as a standalone | |
| 207 | +server](../any/none.md). And if you want nginx to [provide TLS | |
| 208 | +encryption for Fossil][tls], proxying HTTP instead of SCGI provides no | |
| 209 | +benefit. | |
| 210 | + | |
| 211 | +However, it is still worth showing the proper method of proxying | |
| 212 | +Fossil’s HTTP server through nginx if only to make reading nginx | |
| 213 | +documentation on other sites easier: | |
| 214 | + | |
| 215 | + location /code { | |
| 216 | + rewrite ^/code(/.*) $1 break; | |
| 217 | + proxy_pass http://127.0.0.1:12345; | |
| 218 | + } | |
| 219 | + | |
| 220 | +The most common thing people get wrong when hand-rolling a configuration | |
| 221 | +like this is to get the slashes wrong. Fossil is senstitive to this. For | |
| 222 | +instance, Fossil will not collapse double slashes down to a single | |
| 223 | +slash, as some other HTTP servers will. | |
| 224 | + | |
| 201 | 225 | *[Return to the top-level Fossil server article.](../)* |
| 202 | 226 |
| --- www/server/debian/nginx.md | |
| +++ www/server/debian/nginx.md | |
| @@ -66,15 +66,15 @@ | |
| 66 | |
| 67 | Fossil provides four major ways to access a repository it’s serving |
| 68 | remotely, three of which are straightforward to use with nginx: |
| 69 | |
| 70 | * **HTTP** — Fossil has a built-in HTTP server: [`fossil |
| 71 | server`](/help/server). While this method is efficient and it’s |
| 72 | possible to use nginx to proxy access to another HTTP server, this |
| 73 | option is overkill for our purposes. nginx is itself a fully |
| 74 | featured HTTP server, so we will choose in this guide not to make |
| 75 | nginx reinterpret Fossil’s implementation of HTTP. |
| 76 | |
| 77 | * **CGI** — This method is simple but inefficient, because it launches |
| 78 | a separate Fossil instance on every HTTP hit. |
| 79 | |
| 80 | Since Fossil is a relatively small self-contained program, and it’s |
| @@ -196,6 +196,30 @@ | |
| 196 | |
| 197 | The configuration for `foo.net` is similar. |
| 198 | |
| 199 | See [the nginx docs](http://nginx.org/en/docs/) for more ideas. |
| 200 | |
| 201 | *[Return to the top-level Fossil server article.](../)* |
| 202 |
| --- www/server/debian/nginx.md | |
| +++ www/server/debian/nginx.md | |
| @@ -66,15 +66,15 @@ | |
| 66 | |
| 67 | Fossil provides four major ways to access a repository it’s serving |
| 68 | remotely, three of which are straightforward to use with nginx: |
| 69 | |
| 70 | * **HTTP** — Fossil has a built-in HTTP server: [`fossil |
| 71 | server`](../any/none.md). While this method is efficient and it’s |
| 72 | possible to use nginx to proxy access to another HTTP server, we |
| 73 | don’t see any particularly good reason to make nginx reinterpret |
| 74 | Fossil’s own implementation of HTTP when we have a better option. |
| 75 | (But see [below](#http).) |
| 76 | |
| 77 | * **CGI** — This method is simple but inefficient, because it launches |
| 78 | a separate Fossil instance on every HTTP hit. |
| 79 | |
| 80 | Since Fossil is a relatively small self-contained program, and it’s |
| @@ -196,6 +196,30 @@ | |
| 196 | |
| 197 | The configuration for `foo.net` is similar. |
| 198 | |
| 199 | See [the nginx docs](http://nginx.org/en/docs/) for more ideas. |
| 200 | |
| 201 | |
| 202 | ## <a name="http"></a>Proxying HTTP Anyway |
| 203 | |
| 204 | [Above](#modes), we argued that proxying SCGI is a better option than |
| 205 | making nginx reinterpret Fossil’s own implementation of HTTP. If you |
| 206 | want Fossil to speak HTTP, just [set Fossil up as a standalone |
| 207 | server](../any/none.md). And if you want nginx to [provide TLS |
| 208 | encryption for Fossil][tls], proxying HTTP instead of SCGI provides no |
| 209 | benefit. |
| 210 | |
| 211 | However, it is still worth showing the proper method of proxying |
| 212 | Fossil’s HTTP server through nginx if only to make reading nginx |
| 213 | documentation on other sites easier: |
| 214 | |
| 215 | location /code { |
| 216 | rewrite ^/code(/.*) $1 break; |
| 217 | proxy_pass http://127.0.0.1:12345; |
| 218 | } |
| 219 | |
| 220 | The most common thing people get wrong when hand-rolling a configuration |
| 221 | like this is to get the slashes wrong. Fossil is senstitive to this. For |
| 222 | instance, Fossil will not collapse double slashes down to a single |
| 223 | slash, as some other HTTP servers will. |
| 224 | |
| 225 | *[Return to the top-level Fossil server article.](../)* |
| 226 |