[Solved] SELF_URL_PATH on https prevents Tiny Tiny RSS to start

If I set up the value of SELF_URL_PATH to the https address of my installation (say https://example.org/tt-rss/), I get the following error message:

Startup failed
Please set SELF_URL_PATH to the correct value detected for your server: http://example.org/tt-rss/

The problem is that with SELF_URL_PATH on http, the cached images served by af_zz_imgproxy are served with http URLs instead of https.
It used to work with SELF_URL_PATH on https with an older install (Arch Linux package, version 1:17.4.r42.g07d3431e-1), but it doesn’t work with the current git version, commit 22adcd7466.

It may be related to the fact that the server, Nginx, listens on port 80, and the TLS connection is provided by another tool, stunnel.

Platform: Arch Linux, PostgreSQL 9.6.3, Nginx 1.12.1, PHP 7.1.9

In case this is relevant, here is the Nginx configuration:

http {
  include       mime.types;
  default_type  application/octet-stream;
  sendfile        on;
  keepalive_timeout  65;

  server {
    listen       80;
    server_name  example.org;
    root   /srv/http/example.org/htdocs;

    location / {
      index  index.html index.htm index.php;
      autoindex on;
    }

    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
      root   /usr/share/nginx/html;
    }

    location ~ \.php$ {
      fastcgi_pass   unix:/run/php-fpm/php-fpm.sock;
      fastcgi_index  index.php;
      fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
      include        fastcgi.conf;
    }

    location /tt-rss/ {
      if ($remote_addr != 127.0.0.1) {
        return 301 https://$host$request_uri;
      }
      index  index.html index.htm index.php;
    }
  }
}

you can disable this check via config.php knob (_SKIP_SELF_URL_PATH_CHECKS).

Thanks fox, my install works nicely now.

If I may suggest, that could be useful to mention this option in the config.php-dist next to the SELF_URL_PATH part.

le advanced arch users who need to use stunnel for ssl for whatever reason should be able to figure this out while everyone else is unaffected. bloating up configuration files with stuff the majority does not need is bad design.

I discovered a perfect solution.

I opened the config.php file in the root installation directory.

I located line 21 with define(‘SELF_URL_PATH’, ‘http://www.domain.com/subdirectory/’);

I changed the link to https define(‘SELF_URL_PATH’, ‘https://www.domain.com/subdirectory/’);

Refreshed, and it worked. no skip necessary. Good luck users