Hello,
This is my first time ever I am trying to deploy my web api to nginx, so I have a lot of question marks above my head.
I have been following this tutorial:
https://docs.microsoft.com/en-us/aspnet/core/publishing/linuxproduction
and I have stuck at configuring my kestrel service.
This is what I have:
[Unit] Description=Smity Web Api application [Service] WorkingDirectory=/home/user/smity/asp.net-web-api/Smity API/Smity API/bin/Debug/netcoreapp1.1/ ExecStart=/usr/bin/dotnet /home/user/smity/asp.net-web-api/Smity API/Smity API/bin/Debug/netcoreapp1.1/Smity API.dll Restart=always RestartSec=10 # Restart service after 10 seconds if dotnet service crashes SyslogIdentifier=dotnet-example User=www-data Environment=ASPNETCORE_ENVIRONMENT=Production [Install] WantedBy=multi-user.target
and I can't start the service. I mean, sometimes when I run systemctl start kestrel-smityapi.service, status shows it is active but it seems it is not active cause I always get "Failed to start Smity Web Api application"/"Failed with result 'exit code'"/"Unit entered failed state"/"kestrel-smityapi.service: Service hold-off time over, scheduling restart.". Working directory path and ExecStart paths are correct.
I have been spending hours figuring out what am I doing wrong, but I can't break the wall. I am new to Linux in general and to asp.net (done few web api before, but that was long time ago).
Does anyone know how to do this part properly?
Thank you