- Newest
- Most votes
- Most comments
If you have two .NET applications in your bundle, EB will create a Procfile for you which runs the first application alphabetically (in this case, my API) even if that's not the application you are publishing. In order to fix this, you need to create your own Procfile that runs the correct .NET Core application.
answered a year ago
Based on your description, you're experiencing a common issue where your .NET 9 MVC application is working for API endpoints but returning 404 errors for static content and the index page. Since your API endpoints are accessible, the core application is running correctly, which suggests this is likely a routing or static file serving issue.
Here are some potential causes and solutions:
-
Static Website Hosting Configuration: Ensure that your application is properly configured to serve static files. In your .NET application, check that you have services like
app.UseStaticFiles()in your Program.cs or Startup.cs file. -
URL Access Issues: Verify you're accessing the correct URL. Sometimes applications expect specific routes that don't match what you're trying to access.
-
Routing Configuration: Check your MVC routing configuration. The default route might not be properly set up to handle the root path or specific paths you're trying to access.
-
Content-Type Headers: Ensure that the content types for your static files are correctly set.
-
File Permissions: If you're hosting on AL2023, check that the application has proper permissions to access and serve the static files.
-
Application Preview Issues: If you're trying to access the application through a preview feature, ensure you're not using localhost or 127.0.0.1 in your URLs, as these would attempt to access resources on your local computer rather than on the server.
-
Host Header Configuration: Some hosting setups require specific Host headers to properly route traffic. This is particularly important if you're using a reverse proxy or load balancer.
To troubleshoot further:
- Check your application logs for specific error messages
- Verify your routing configuration in your .NET application
- Try accessing the application with explicit paths rather than relying on default routing
- Use network tools like telnet to check connectivity to your application on the appropriate port
- Review your web server configuration (if using IIS, Nginx, or Apache in front of your .NET app)
Sources
Rendering problem of the static website hosting | AWS re:Post
Troubleshooting AWS Cloud9 - AWS Cloud9
answered a year ago
Relevant content
asked 3 years ago
asked 4 years ago
- AWS OFFICIALUpdated 3 months ago
- AWS OFFICIALUpdated 5 years ago

Useless. Can I get an answer from a human being?