Hi kyp_,
could you please post the relevant parts of your nginx config? The php handler part including all fastcgi params in particular.
As an example, here is mine:
location ~ ^(?<script_name>.+?\.php)(?<path_info>/.*)?$ { try_files $script_name =404; include /etc/nginx/fastcgi_params; fastcgi_pass php70-php-fpm; fastcgi_param PATH_INFO $path_info; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_read_timeout 300; }
And fastcgi_params includes following interesting lines:
fastcgi_param REQUEST_SCHEME $scheme; fastcgi_param HTTPS $https if_not_empty;
Last edited by teekay (2016-10-21 09:49:09)
Offline
@kyp_ sorry I forgot to answer back
we were suggesting to place the test inside the function get_absolute_root_url not in the tpl
Offline
All fastcgi params,
the 2 values you've asked about are NOT set:
fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length; fastcgi_param SCRIPT_NAME $fastcgi_script_name; fastcgi_param REQUEST_URI $request_uri; fastcgi_param DOCUMENT_URI $document_uri; fastcgi_param DOCUMENT_ROOT $document_root; fastcgi_param SERVER_PROTOCOL $server_protocol; fastcgi_param GATEWAY_INTERFACE CGI/1.1; fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; fastcgi_param REMOTE_ADDR $remote_addr; fastcgi_param REMOTE_PORT $remote_port; fastcgi_param SERVER_ADDR $server_addr; fastcgi_param SERVER_PORT $server_port; fastcgi_param SERVER_NAME $server_name; # PHP only, required if PHP was built with --enable-force-cgi-redirect fastcgi_param REDIRECT_STATUS 200;
var_dump($_SERVER);
array(38) { ["USER"]=> string(6) "apache" ["HOME"]=> string(8) "/var/www" ["FCGI_ROLE"]=> string(9) "RESPONDER" ["SCRIPT_FILENAME"]=> string(35) "/home/.../public_html/index.php" ["QUERY_STRING"]=> string(25) "/tags/..." ["REQUEST_METHOD"]=> string(3) "GET" ["CONTENT_TYPE"]=> string(0) "" ["CONTENT_LENGTH"]=> string(0) "" ["SCRIPT_NAME"]=> string(10) "/index.php" ["REQUEST_URI"]=> string(36) "/index.php?/tags/..." ["DOCUMENT_URI"]=> string(10) "/index.php" ["DOCUMENT_ROOT"]=> string(25) "/home/.../public_html" ["SERVER_PROTOCOL"]=> string(8) "HTTP/1.1" ["GATEWAY_INTERFACE"]=> string(7) "CGI/1.1" ["SERVER_SOFTWARE"]=> string(12) "nginx/1.0.15" ["REMOTE_ADDR"]=> string(12) "..." ["REMOTE_PORT"]=> string(5) "39710" ["SERVER_ADDR"]=> string(14) "..." ["SERVER_PORT"]=> string(2) "80" ["SERVER_NAME"]=> string(11) "domain.com" ["REDIRECT_STATUS"]=> string(3) "200" ["HTTP_HOST"]=> string(11) "domain.com" ["HTTP_ACCEPT_ENCODING"]=> string(4) "gzip" ["HTTP_CF_IPCOUNTRY"]=> string(2) "..." ["HTTP_X_FORWARDED_FOR"]=> string(13) "..." ["HTTP_CF_RAY"]=> string(20) "...8-VIE" ["HTTP_X_FORWARDED_PROTO"]=> string(4) "http" ["HTTP_CF_VISITOR"]=> string(17) "{"scheme":"http"}" ["HTTP_UPGRADE_INSECURE_REQUESTS"]=> string(1) "1" ["HTTP_USER_AGENT"]=> string(110) "Mozilla/5.0 (Windows NT 10.0; WOW64)..." ["HTTP_ACCEPT"]=> string(74) "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8" ["HTTP_REFERER"]=> string(44) "http://domain.com/index.php?/tags/..." ["HTTP_ACCEPT_LANGUAGE"]=> string(23) "en-US,en;q=0.8,de;q=0.6" ["HTTP_COOKIE"]=> string(106) "__cfduid=d...; pwg_id=v...; page-menu=visible" ["HTTP_CF_CONNECTING_IP"]=> string(13) "..." ["PHP_SELF"]=> string(10) "/index.php" ["REQUEST_TIME_FLOAT"]=> float(14...) ["REQUEST_TIME"]=> int(14...) }
Offline
Is there any more Information that I can provide?
Offline
Did you try to set the HTTPS fastcgi_param?
Offline
I've tried:
fastcgi_param HTTPS on;
But nothing changed, HTTPS on index.php still has absolute-paths for /combined/
Purged the templates via maintenance as well.
How come picture.php is working though - it shows a relative-path since before the 'HTTPS on'.
Offline
Sooo,
anything else that I could try?
Offline
Hi kyp_,
On Piwigo.com servers, running with Nginx, we have:
fastcgi_param HTTPS $https;
and HTTPS works perfectly fine :-)
Offline
Hello,
nginx: [emerg] unknown "https" variable nginx: configuration file /etc/nginx/nginx.conf test failed
Nginx won't start after adding the line you suggested.
Thanks for helping me with this :)
Offline
Which version of Nginx are you running? http://nginx.org/en/docs/http/ngx_http_ … #var_https says :
$https
“on” if connection operates in SSL mode, or an empty string otherwise
Offline
Nginx v.1.0.15
Offline
cough ... you like to run old software, don't you? Piwigo 2.7.4, Nginx 1.0.15 ... that's ~4 years old.
Offline
Hello,
I've switched back to Apache:
Apache/2.2.15 (CentOS)
PHP Version 5.4.45
Aaaaand the problem persists:
picture.php works on HTTPS
index.php does NOT_work on HTTPS
With the plugin "Force HTTPS (1.5.0)" it creates and endless redirect-loop:
net::ERR_TOO_MANY_REDIRECTS
Sooo, any ideas?
regards,
kyp
Offline