From 63a19cd2f495cde99af6ee5da79ea66e6d07c19a Mon Sep 17 00:00:00 2001 From: Anthony Prades Date: Sun, 15 Nov 2015 00:56:17 +0100 Subject: [PATCH 1/2] Imp: adapt NGinx configuration file if TinyTinyRss is not locate in web site root, based on SELF_URL_PATH. --- configure-db.php | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/configure-db.php b/configure-db.php index 8f9b1e3..b9035d1 100644 --- a/configure-db.php +++ b/configure-db.php @@ -106,6 +106,34 @@ foreach ($config as $name => $value) { } file_put_contents($confpath, $contents); +$urlParts = parse_url($config['SELF_URL_PATH']); +if( $urlParts['path'] != '' && $urlParts['path'] != '/' ) { + $nginx = 'server { + listen 80; + + index index.php index.html; + + location / { + rewrite ^ ' . $config['SELF_URL_PATH'] . '; + } + + location ' . rtrim($urlParts['path'], '/') . ' { + alias /var/www; + try_files $uri $uri/ =404; + + location ~ \.php$ { + allow all; + fastcgi_split_path_info ^(.+\.php)(/.+)$; + fastcgi_pass unix:/var/run/php5-fpm.sock; + fastcgi_index index.php; + include fastcgi_params; + } + } +}'; + + file_put_contents("/etc/nginx/sites-enabled/ttrss", $nginx); +} + function env($name, $default = null) { $v = getenv($name) ?: $default; From 70f05350e52c80497392939a45d190005561f41d Mon Sep 17 00:00:00 2001 From: Anthony Prades Date: Sun, 15 Nov 2015 19:32:27 +0100 Subject: [PATCH 2/2] Feature: add build script --- build-ttrssImage.sh | 3 +++ 1 file changed, 3 insertions(+) create mode 100755 build-ttrssImage.sh diff --git a/build-ttrssImage.sh b/build-ttrssImage.sh new file mode 100755 index 0000000..27f6a0d --- /dev/null +++ b/build-ttrssImage.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +docker build --rm -t toony/ttrss .