Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty requirejs-config when using https #5977

Closed
giacmir opened this issue Aug 4, 2016 · 4 comments
Closed

Empty requirejs-config when using https #5977

giacmir opened this issue Aug 4, 2016 · 4 comments

Comments

@giacmir
Copy link
Member

giacmir commented Aug 4, 2016

I recently switched a production store to have backend and frontend protected pages under https (using the configuration panel). When recompiling static assets then _pub/static/requirejs/adminhtml/Magento/backend/en_US/secure/requirejs-config.js is empty and the website is broken.

Switching back to http solves the issue.

Preconditions

  1. Magento 2.0.8 production mode
  2. php 7.0.8

Steps to reproduce

  1. configure Magento to use secure url in admin
  2. recompile static assets
  3. empty cache

Expected result

  1. Magento backend should operate normally

Actual result

  1. After login the interface is present but not usable (menus doesn't slide, notifies does not appear, etc)
@AntonEvers
Copy link
Contributor

The problem lies here https://github.com/magento/magento2/blob/2.1/lib/internal/Magento/Framework/View/Asset/File/FallbackContext.php#L106 and here https://github.com/magento/magento2/blob/2.1/lib/internal/Magento/Framework/HTTP/PhpEnvironment/Request.php#L412

While running the magento setup:static-content:deploy command $_SERVER['HTTPS'] and $_SERVER['SERVER_PORT'] are not set so the generation context is considered 'unsecure'.

At the moment the deployment script is only capable of generating secure OR unsecure content and not both.

The thing is... the contents of pub/static/_requirejs/.../requirejs-config.js and pub/static/_requirejs/.../secure/requirejs-config.js are exactly the same if they are generated with developer mode on. So I wonder why the secure version is created in the first place. The release notes of the commit introducing this code don't mention anything about the http/https distinction in requirejs-config.js file generation.

My proposition would be to use pub/static/_requirejs/.../requirejs-config.js for both secure and unsecure requests. I'll create a pull request for this.

@IlnitskiyArtem
Copy link

Thanks for the feedback. Unfortunately, I could not reproduce the issue. May please let me know if this issue relevant for latest release of Magento 2? And please provide the detailed steps we must follow to reproduce this issue. In addition, identify the web server you are running, the versions of MySQL, and any other information needed to reproduce your issue.

@veloraven
Copy link
Contributor

According to contributor guide, tickets without response for two weeks should be closed.
If this issue still reproducible please feel free to create the new one: format new issue according to the Issue reporting guidelines: with steps to reproduce, actual result and expected result and specify Magento version.

@hostep
Copy link
Contributor

hostep commented Jul 25, 2017

@IlnitskiyArtem & @veloraven: this is probably a duplicate of #4961, you can find a little bit of info over there about how to reproduce.

magento-engcom-team pushed a commit that referenced this issue Aug 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants