Skip to content
This repository has been archived by the owner on Apr 21, 2023. It is now read-only.

Https rewrite issue #1214

Closed
apedicdev opened this issue Jun 14, 2016 · 5 comments
Closed

Https rewrite issue #1214

apedicdev opened this issue Jun 14, 2016 · 5 comments

Comments

@apedicdev
Copy link

apedicdev commented Jun 14, 2016

Hello, we have currently a magento store hosted on an nginx web server with page speed enabled. We're having a issue with rewrites as it seems with page speed enabled the rewrite will cause a protocol chain like https -> http -> https. We contacted the host support and they believe is a page speed bug because, when disabled, the issue doesn't occur.

Here is it a redirect test where you can see the double rewrite

 >>> https://www.vashi.com/round-cut-0-95-carat-halo-engagement-ring-with-side-stones-in-platinum.html

> --------------------------------------------
> 301 Moved Permanently
> --------------------------------------------

Status: 301 Moved Permanently
Code:   301
Content-Type:   text/html; charset=UTF-8
Location:   http://www.vashi.com/round-cut-0-95-carat-halo-with-side-stones-in-platinum.html
Cache-Control:  no-store, no-cache, must-revalidate, post-check=0, pre-check=0, s-maxage=0
Pragma: no-cache
Content-Length: 0
Accept-Ranges:  bytes
Date:   Tue, 14 Jun 2016 16:48:32 GMT
Connection: close
Server: MageStack-MagentoOS
Strict-Transport-Security:  max-age=0




>>> http://www.vashi.com/round-cut-0-95-carat-halo-with-side-stones-in-platinum.html

> --------------------------------------------
> 301 Moved Permanently
> --------------------------------------------

Status: 301 Moved Permanently
Code:   301
Content-Type:   text/html
Location:   https://www.vashi.com/round-cut-0-95-carat-halo-with-side-stones-in-platinum.html
Content-Length: 374
Accept-Ranges:  bytes
Date:   Tue, 14 Jun 2016 16:48:32 GMT
Connection: close
Server: MageStack-MagentoOS




>>> https://www.vashi.com/round-cut-0-95-carat-halo-with-side-stones-in-platinum.html

> --------------------------------------------
> 200 OK
> --------------------------------------------

Status: 200 OK
Code:   200
Content-Type:   text/html; charset=UTF-8
Vary:   Accept-Encoding
Cache-Control:  no-store, no-cache, must-revalidate, post-check=0, pre-check=0, s-maxage=0
Set-Cookie: frontend=alcm52jd6gtijd4i588fll5f16; expires=Tue, 14-Jun-2016 17:48:32 GMT; path=/; domain=www.vashi.com; HttpOnly
Pragma: no-cache
Date:   Tue, 14 Jun 2016 16:48:33 GMT
Connection: close
Server: MageStack-MagentoOS
Strict-Transport-Security:  max-age=0
@oschaaf
Copy link
Member

oschaaf commented Jun 14, 2016

Requesting with pagespeed off shows the redirect originally is specified relative:

oschaaf$ curl -I  https://www.vashi.com/round-cut-0-95-carat-halo-engagement-ring-with-side-stones-in-platinum.html?PageSpeed=off
HTTP/1.1 301 Moved Permanently
Content-Type: text/html; charset=UTF-8
Location: /round-cut-0-95-carat-halo-with-side-stones-in-platinum.html
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0, s-maxage=0
Expires: Mon, 31 Mar 2008 10:00:00 GMT
Pragma: no-cache
Content-Length: 0
Accept-Ranges: bytes
Date: Tue, 14 Jun 2016 17:24:25 GMT
Server: MageStack-MagentoOS
Strict-Transport-Security: max-age=0

This looks very similar to what #1055 fixed for when proxying relative redirects [1]. I need to debug more to see if I can reproduce this in php, but meantime a workaround may be to use an absolute url in the redirects if possible.

[1] details: #819 (comment)

@apedicdev
Copy link
Author

thank you, we will try to implement your proposed workaround, but as far as i know in the magento rewrite table there's not the protocol choice

@oschaaf
Copy link
Member

oschaaf commented Jul 12, 2016

@apedicdev question: which version of ngx_pagespeed is installed?

@apedicdev
Copy link
Author

hello, the version installed is
ngx_pagespeed-module-1.9.32.13

thanks

@oschaaf
Copy link
Member

oschaaf commented Jul 24, 2016

@apedicdev This issue was fixed in 40c05b4 which was included since v1.10.33.0-beta

So you could:

  • Cherry-pick 40c05b4 (hopefully it applies cleanly)
  • Upgrade to a later version. My advice would be 1.11.33.2 as it is build against the latest stable release of the PageSpeed optimization libraries
  • This issue aside, I would recommend upgrading to at least 1.9.32.14 - see [1]

Closing this issue, but please re-open if it turns out none of the options above fixed the problem.

[1] https://developers.google.com/speed/pagespeed/module/release_notes#release_1.9.32.14-stable

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants