update gitit instructions with reverse proxy

This commit is contained in:
Trent Palmer 2017-07-17 03:26:40 -07:00
parent 7f4b6bc5c1
commit f2399ba6a1
5 changed files with 68 additions and 13 deletions

View File

@ -178,3 +178,33 @@ find git. But the symlink solution is easy enough.
```csh
ln -s /usr/local/bin/git /usr/bin/
```
And you might as well stick a reverse proxy in front of it. Assuming
you configure gitit listen only on localhost:5001, install nginx.
`pkg install nginx`
enable nginx in /etc/rc.conf
```conf
nginx_enable="YES"
```
Then, in the file `/usr/local/etc/nginx/nginx.conf` change the location "*/*"
so that it looks like this.
```nginx
{
.....
location / {
# root /usr/local/www/nginx;
# index index.html index.htm;
proxy_pass http://127.0.0.1:5001;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
....
}
```
and then start nginx `service nginx start`

View File

@ -288,6 +288,31 @@ run gitit as a daemon like this, on FreeBSD it will fail because it can't
find git. But the symlink solution is easy enough.</p>
<pre><code class="csh">ln -s /usr/local/bin/git /usr/bin/
</code></pre>
<p>And you might as well stick a reverse proxy in front of it. Assuming
you configure gitit listen only on localhost:5001, install nginx.
<code>pkg install nginx</code></p>
<p>enable nginx in /etc/rc.conf</p>
<pre><code class="conf">nginx_enable=&quot;YES&quot;
</code></pre>
<p>Then, in the file <code>/usr/local/etc/nginx/nginx.conf</code> change the location "<em>/</em>"
so that it looks like this.</p>
<pre><code class="nginx">{
.....
location / {
# root /usr/local/www/nginx;
# index index.html index.htm;
proxy_pass http://127.0.0.1:5001;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
....
}
</code></pre>
<p>and then start nginx <code>service nginx start</code></p>
</div>
</div>

View File

@ -204,5 +204,5 @@
<!--
MkDocs version : 0.16.3
Build Date UTC : 2017-07-16 11:50:18
Build Date UTC : 2017-07-17 10:26:28
-->

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
<url>
<loc>/</loc>
<lastmod>2017-07-16</lastmod>
<lastmod>2017-07-17</lastmod>
<changefreq>daily</changefreq>
</url>
@ -12,7 +12,7 @@
<url>
<loc>/serve_and_share_apps_from_your_phone_with_fdroid/</loc>
<lastmod>2017-07-16</lastmod>
<lastmod>2017-07-17</lastmod>
<changefreq>daily</changefreq>
</url>
@ -20,7 +20,7 @@
<url>
<loc>/nspawn/</loc>
<lastmod>2017-07-16</lastmod>
<lastmod>2017-07-17</lastmod>
<changefreq>daily</changefreq>
</url>
@ -28,7 +28,7 @@
<url>
<loc>/mastodon_on_arch/</loc>
<lastmod>2017-07-16</lastmod>
<lastmod>2017-07-17</lastmod>
<changefreq>daily</changefreq>
</url>
@ -36,7 +36,7 @@
<url>
<loc>/debian_nspawn_container_on_arch_for_testing_apache_configurations/</loc>
<lastmod>2017-07-16</lastmod>
<lastmod>2017-07-17</lastmod>
<changefreq>daily</changefreq>
</url>
@ -44,7 +44,7 @@
<url>
<loc>/dynamic_cacheing_nginx_reverse_proxy_for_pacman/</loc>
<lastmod>2017-07-16</lastmod>
<lastmod>2017-07-17</lastmod>
<changefreq>daily</changefreq>
</url>
@ -52,7 +52,7 @@
<url>
<loc>/freebsd_jails_on_freenas/</loc>
<lastmod>2017-07-16</lastmod>
<lastmod>2017-07-17</lastmod>
<changefreq>daily</changefreq>
</url>
@ -60,7 +60,7 @@
<url>
<loc>/arch_redis_nspawn/</loc>
<lastmod>2017-07-16</lastmod>
<lastmod>2017-07-17</lastmod>
<changefreq>daily</changefreq>
</url>
@ -68,7 +68,7 @@
<url>
<loc>/arch_postgresql_nspawn/</loc>
<lastmod>2017-07-16</lastmod>
<lastmod>2017-07-17</lastmod>
<changefreq>daily</changefreq>
</url>
@ -76,7 +76,7 @@
<url>
<loc>/self_signed_certs/</loc>
<lastmod>2017-07-16</lastmod>
<lastmod>2017-07-17</lastmod>
<changefreq>daily</changefreq>
</url>