if I manully go to address mywebsite.com/post/my-post/index.html then I can see my blog post. What settings needs to be changed to point it to index.html without ugly urls?
The 404 error might be happening because you are missing a layout for your posts. Make sure that you have the following files in your layouts directory:
|-- layouts
| |-- posts
| | |-- [ ] list.html
| | |-- [ ] single.html
Include a link to the source code repository of your project, because we really need the context of seeing your templates and partials to be able to help you. It is trivial to do a quick git clone on your repo, then run hugo server in your project, to help you out. On the other hand, recreating your code from screenshots, or sort of guessing at it, is not.
If you can’t share your repository for whatever reason, consider creating a dummy repo that you can share, which reproduces the problem you’re experiencing.
I have moved away from Github and using Code commit for CI CD with AWS Codepipeline and other resources. I am keeping code commit private. But I copied the code and published to github for this question.
As I mentioned earlier I am deploying to AWS. Specifically S3 with cloudfront cache. Also website is not served via S3 but its served exclusively though Cloudfront. And I have set defaultRootObject to be index.html. There is no other webserver configuration available in S3 or Cloudfront. If there is then please let me know.
Aparantly this is a known bug in cloudfront. Other users have faced same issue. There is temporary workaround given in the blog post but its not working for me.
The actual solution is to uglify the urls. and have full page.html for each page.