Announcement

#16 2016-10-21 09:30:54

teekay
Member
2013-06-12
427

Re: Switch to HTTPS keeps an absolute path for /combined/

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:

Code:

 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:

Code:

fastcgi_param  REQUEST_SCHEME     $scheme;
fastcgi_param  HTTPS              $https if_not_empty;

Last edited by teekay (2016-10-21 09:49:09)

Offline

 

#17 2016-10-21 12:44:05

flop25
Piwigo Team
2006-07-06
7037

Re: Switch to HTTPS keeps an absolute path for /combined/

@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


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#18 2016-10-23 02:53:27

kyp_
Member
2013-06-17
84

Re: Switch to HTTPS keeps an absolute path for /combined/

All fastcgi params,
the 2 values you've asked about are NOT set:

Code:

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);

Code:

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...)
}

Cheers

Offline

 

#19 2016-10-28 18:27:39

kyp_
Member
2013-06-17
84

Re: Switch to HTTPS keeps an absolute path for /combined/

Is there any more Information that I can provide?


Cheers

Offline

 

#20 2016-10-28 19:08:52

teekay
Member
2013-06-12
427

Re: Switch to HTTPS keeps an absolute path for /combined/

Did you try to set the HTTPS fastcgi_param?

Offline

 

#21 2016-11-01 17:02:59

kyp_
Member
2013-06-17
84

Re: Switch to HTTPS keeps an absolute path for /combined/

I've tried:

Code:

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'.


Cheers

Offline

 

#22 2016-11-10 02:18:21

kyp_
Member
2013-06-17
84

Re: Switch to HTTPS keeps an absolute path for /combined/

Sooo,

anything else that I could try?


Cheers

Offline

 

#23 2016-11-10 11:33:08

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13786

Re: Switch to HTTPS keeps an absolute path for /combined/

Hi kyp_,

On Piwigo.com servers, running with Nginx, we have:

Code:

fastcgi_param   HTTPS                   $https;

and HTTPS works perfectly fine :-)

Offline

 

#24 2016-11-10 18:25:29

kyp_
Member
2013-06-17
84

Re: Switch to HTTPS keeps an absolute path for /combined/

Hello,

Code:

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 :)


Cheers

Offline

 

#25 2016-11-10 19:12:04

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13786

Re: Switch to HTTPS keeps an absolute path for /combined/

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

 

#26 2016-11-11 03:20:48

kyp_
Member
2013-06-17
84

Re: Switch to HTTPS keeps an absolute path for /combined/

Nginx v.1.0.15


Cheers

Offline

 

#27 2016-11-12 13:25:11

erAck
Only trying to help
2015-09-06
1998

Re: Switch to HTTPS keeps an absolute path for /combined/

cough ... you like to run old software, don't you? Piwigo 2.7.4, Nginx 1.0.15 ... that's ~4 years old.


Running Piwigo at https://erack.net/gallery/

Offline

 

#28 2016-12-02 16:16:43

kyp_
Member
2013-06-17
84

Re: Switch to HTTPS keeps an absolute path for /combined/

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


Cheers

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact