Hugo site url’s download a randomly named empty file instead of displaying page

Howdy; attempting to setup a Hugo site for the first time but am running into issues when using the live version.

I created a site following the quickstart guide.

I only differences is for the base url I’m using

baseURL = 'https://example.org/blogtest/'

I made a few test post and every thing is running as expected on ‘http://localhost:1313/blogtest/

However when visiting the public version at ‘https://example.org/blogtest/’ the web browser just downloads a random empty file instead of displaying the page. If I manually goto http://example.org/blogtest/index.html the site displays fine, but click on any of the page’s links will again just download a random empty file.

What am I doing wrong?

Also the site is hosted on a AWS S3 bucket, if that makes any difference. Maybe there’s an issue with the bucket settings instead of it being a issue with the Hugo config?

Thanks for your time!

  1. What do you mean by ‘random empty file’? Is a file or is an empty page?
  2. Are your posts drafts and not being built for production?
  3. Have you checked the bucket; are the files from /public in your bucket?
  4. It would be helpful to see your repository and the workflow you use to publish your site.
  5. example.com leaves us blindly guessing, especially since you also do not provide a repo. If you cannot provide the actual information, please create a minimal public project that demonstrates the issue.
1 Like
  1. Going to ‘(can’t post multiple links)/blogtest/’ downloads a file with a random name ie. ‘2sbBIYUF

‘ or ‘-jK3Mq8S.’ The file is 0kb, has no file extention, and it’s blank when opened with a text editor.

  1. Posts include ‘draft: false’

  2. I copied all the files form the output /public directory and uploaded them to ‘(can’t post multiple links)/blogtest/’

This is not a Hugo issue. You have misconfigured your S3 bucket. See @frjo’s response.

1 Like

Okay, I’ll play around with the S3 configs. Thanks everyone!

For future googlers, it was an issue with CloudFront not being able to redirect index.htmls in the S3 bucket’s sub directories. This fixed the issue.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.