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

Redirect for root doesn't seem to work #135

Closed
cancan101 opened this issue May 23, 2019 · 3 comments
Closed

Redirect for root doesn't seem to work #135

cancan101 opened this issue May 23, 2019 · 3 comments

Comments

@cancan101
Copy link

This does not seem to work:

    "redirects": {
      "/": {
        "url": "https://page.example"
      }
    }

Instead I get in the logs:

[error] 35#0: *6 directory index of "./dist/" is forbidden, client: XXXX, server: , request: "GET / HTTP/1.1", host: "YYYYY-pr-23.herokuapp.com"
@cancan101
Copy link
Author

cancan101 commented May 24, 2019

Probably due to this block being explicit :

location / {
mruby_post_read_handler /app/bin/config/lib/ngx_mruby/headers.rb cache;
mruby_set $fallback /app/bin/config/lib/ngx_mruby/routes_fallback.rb cache;
<% if clean_urls %>
try_files $uri.html $uri $uri/ $fallback;
<% else %>
try_files $uri $uri/ $fallback;
<% end %>
}

@cancan101
Copy link
Author

I followed #53 (comment) and add this script which seems to fix the issue:

sed -i 's:try_files $uri.html $uri $uri/ $fallback;:try_files $uri.html $uri $fallback;:g' /app/bin/config/templates/nginx.conf.erb

@edmorley
Copy link
Member

edmorley commented Jun 9, 2022

Hi

This buildpack is now deprecated and we are recommending people move the more actively maintained heroku-buildpack-nginx. For migration advice see here.

As such, I'm closing this issue out since we won't be making further changes to this buildpack.

@edmorley edmorley closed this as not planned Won't fix, can't repro, duplicate, stale Jun 9, 2022
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