Victor Cavalcante
@vcavalcante
vcavalcante@lambda3.com.br
Kestrel
IIS
WebListenner
DotNet Core
Por questões de segurança é necessário ter um proxy reverso na frente do kestrel
server { listen 8080; location / { proxy_pass http://localhost:5000; } }
/etc/nginx/conf.d/default.conf
>sudo apt-get install nginx >sudo service nginx start
>sudo apt-get install supervisor >dotnet publish >sudo cp -a ~/teste/bin/Debug/netcoreapp1.1/publish /var/meusite
[program:teste] command=/usr/bin/dotnet /var/meusite/teste.dll --server.urls=http://0.0.0.0:5123 directory=/var/meusite autostart=true autorestart=true stderr_logfile=/var/log/dotnettest.err.log stdout_logfile=/var/log/dotnettest.out.log environment=ASPNETCORE_ENVIRONMENT=Production user=www-data stopsignal=INT
/etc/supervisor/conf.d/kestrel_default.conf
>sudo service supervisor start >sudo tail -f /var/log/supervisor/supervisord.log >sudo tail -f /var/log/dotnettest.out.log
8080
5123
8080
5124
5123
5125
>docker-compose up -d
>curl -i http://localhost:9090/api/book
8080
5124
5123
5125
Instale no seu server:
Microsoft.AspNetCore.Server.IISIntegration
<configuration>
<!--
Configure your application settings in appsettings.json. Learn more at http://go.microsoft.com/fwlink/?LinkId=786380
-->
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="%LAUNCHER_PATH%"
arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="true"
stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false" />
</system.webServer>
</configuration>
<configuration>
<!--
Configure your application settings in appsettings.json. Learn more at http://go.microsoft.com/fwlink/?LinkId=786380
-->
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath=".\sample.exe"
arguments="" stdoutLogEnabled="true"
stdoutLogFile="\\?\%home%\LogFiles\stdout" forwardWindowsAuthToken="false" />
</system.webServer>
</configuration>
Web.Config antes antes de publicado
Web.Config depois de publicado
WebListener é um servidor que roda diretamente sobre o Windows HTTP Server API.
•Windows authentication
•Port sharing
•HTTPS
•HTTP/2
•Direct file transmission
•Response caching WebSockets
Dev
Prod
Kestrel
Kestrel
IIS
WebListenner