Skip to content
This repository has been archived by the owner. It is now read-only.

Directly loaded URLs for /api/ fail to load #3024

Closed
mixonic opened this issue Oct 11, 2017 · 6 comments

Comments

@mixonic
Copy link
Member

commented Oct 11, 2017

For example loading: https://emberjs.com/api/ember/2.16/modules/@ember%2Fapplication

The https://github.com/heroku/heroku-buildpack-static uses a rewrite rule for proxying between paths that are different on the client and the proxied-to server. The website's config at https://github.com/emberjs/website/blob/master/static.json for /api/ doesn't use a different path, but regardless it passes through this rewrite.

It is a known issue with nginx https://trac.nginx.org/nginx/ticket/786?cversion=0&cnum_hist=2 that URLs are encoded for location APIs. In practice what is happening is that the %2F is transformed into either a / or a %252F depending on what path we sent it down.

I was able to /api/ work correctly by avoiding the rewrite usage, however this broke the statusboard so I rolled it back. The temporary solution here seem to be hand-coding an nginx config for the API that avoids rewrite and hand-coding one for statusboard that does not (or having only the statusboard use the current system and configuration for heroku-buildpack-static).

@mixonic

This comment has been minimized.

Copy link
Member Author

commented Oct 12, 2017

I've put a temporary fix in place. The Ember.js website is now using the buildpack hosted at https://github.com/mixonic/heroku-buildpack-static. This repo has a commit special-casing the API logic to use a non-rewrite path:

The statusboard continues to use the old, upstream path.

This doesn't seem like a great long-term solution, it would be much nicer to rely on the canonical buildpack or to simply stop using the generalized buildpack if we're going to maintain our own nginx config.

@solocommand

This comment has been minimized.

Copy link

commented Oct 19, 2017

All API URLs are failing for me since yesterday, is this the same issue?

All CSS and JS files are 404ing for me:

https://emberjs.com/assets/vendor-d41d8cd98f00b204e9800998ecf8427e.css
https://emberjs.com/assets/ember-api-docs-059cb03a96ef95cbcb3fafe9b3ee78dc.css
https://emberjs.com/assets/vendor-0b337e88c5b7a635a3281ba1f12d6048.js
https://emberjs.com/assets/ember-api-docs-6fc21f3656d25d4eb09ee1c6a7a419fa.js
https://emberjs.com/assets/vendor-0b337e88c5b7a635a3281ba1f12d6048.js
https://emberjs.com/assets/ember-api-docs-6fc21f3656d25d4eb09ee1c6a7a419fa.js
@acorncom

This comment has been minimized.

Copy link
Member

commented Oct 20, 2017

@solocommand the above issue seems to be a CDN issue from what we've been discussing on Slack, it should be fixed though. Are you still seeing problems?

@solocommand

This comment has been minimized.

Copy link

commented Oct 20, 2017

@acorncom Looks good, thanks! Sorry if this was the wrong place :)

@acorncom

This comment has been minimized.

Copy link
Member

commented Oct 21, 2017

@solocommand no problem, sometimes it's hard to tell where to file these issues 😀

@locks

This comment has been minimized.

Copy link
Contributor

commented Oct 29, 2017

I believe we have address all of the directly loaded URL cases. Thanks everyone!

@locks locks closed this Oct 29, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
4 participants
You can’t perform that action at this time.