dvr
dvr

Reputation: 370

Serve index.html at / aws ebs

I am serving static files using the reverse proxy on nginx.

I am currently using a file.ebextensions/static-files.config.

option_settings:
  aws:elasticbeanstalk:environment:proxy:staticfiles:
    /index: myapp/myapp/static

This works fine, but I must navigate to /index to have these files served. Is there an option to serve them at /? I tried using both "/" and a blank key instead of index and neither worked.

Upvotes: 0

Views: 129

Answers (1)

Hussain Mansoor
Hussain Mansoor

Reputation: 3124

You can use nginx redirection feature for this. You can redirect / to /index easily

NGINX documentation for this: https://www.nginx.com/blog/creating-nginx-rewrite-rules/

or just use rewrite ^/$ /index.html last; ref: https://stackoverflow.com/a/8337492/970422

Upvotes: 1

Related Questions