We are running a Nopcommerce store inside a company infrastructure that has two proxies. There will only one store.
- The first one has SSL certificate for the domain and redirects all traffic from HTTPS to the second proxy.
- The second proxy receives all HTTP traffic and redirects to our app server with IIS.
Problmens with url generation
First of all, we had problems with url generation.
Nopcommerce generates ip url instead of hostname urls. This could be by the redirection.
- The url were generated by .net core Url.RouteUrl helper methos.
- Store URL field is https://xxxxx.xxxx.xx/
- We have activated HTTP_X_FORWARDED_PROTO and second proxy is sending X-Forwarded-Proto, X-Forwarded-Server and X-Forwarded-Host correctly.
Like we have only one store, finally we solve introducing the next line of code to force host in all request.
application.Use((context, next) =>
{
context.Request.Host = new Microsoft.AspNetCore.Http.HostString("xxxxx.xxx.xx");
context.Request.Headers["Host"] = "xxxxx.xxx.xx";
return next();
});
Schedule task ends with error
- All task are running but we always get this error.
- We thing is related to proxy and security settings. ¿Is ther a way to
La tarea programada "Send emails" falló con el error "The SSL connection could not be established, see inner exception." (Tipo de tarea: "Nop.Services.Messages.QueuedMessagesSendTask, Nop.Services". Nombre de la tienda: "XXXXX XXX". Dirección de ejecución de la tarea: "https://xxxxx.xxxx.xx/scheduletask/runtask").