Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

423
Vistas
Can't see cause of error in .NET Core 2.2 web app running on Ubuntu behind NGINX proxy

I have an Ubuntu server running NGINX as a reverse proxy to an ASP.NET Core 2.2 web API, and I am having trouble diagnosing a 500 server error I keep getting on requests to the API.

I have looked through all the logs I can see in /var/logs, the application logs which are set to trace, and the nginx error logs which are set to debug. However there is no clue about where the error lies.

All requests to the API are failing with the same 500 response, except for one which is the IdentityServer authentication token endpoint which does work. That is running in the same API.

I suspect the issue may be early in the request pipeline, before it comes into my controller actions.

There is a SQL Server database on the server but it is not being accessed for the particular requests I am trying so I am ruling that out.

My question is where else can I look to see what is going on? It must be something related to the application as that is the only thing that has changed, and another site running behind NGINX on the same machine is working fine so I'm not blaming the NGINX config.

When I revert the whole server to a backup before the deployment was done, everything runs fine. The deployment of the application code breaks something but I just can't find out what or why.

The 500 error response is very plain without the usual headers. NGINX has been configured to add a lot more response headers than this.

HTTP/1.1 500 Internal Server Error
Server: nginx
Date: Thu, 05 Mar 2020 21:12:54 GMT
Content-Length: 0
Connection: keep-alive
Keep-Alive: timeout=30
over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

The problem was with some code inside a constructor that was being called during application startup during dependency injection instantiation.

There was no problem while developing locally with 'dotnet run', but when publishing the files in Debug or Release mode, then it threw an exception.

The error was found after adding this line to the Startup.Configure method:

 app.UseDeveloperExceptionPage();

This enabled me to see the error clearly straight away. This error was not seen in any other logs, and the error only occurred when running published files, hence the difficulty in diagnosing the problem.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda