[Unit]Description=Web API Application running on CentOS[Service]WorkingDirectory=/home/websiteExecStart=/usr/bin/dotnet /home/website/website.dllRestart=alwaysRestartSec=10 # Restart service after 10 seconds if dotnet service crashesSyslogIdentifier=websiteUser=rootEnvironment=ASPNETCORE_ENVIRONMENT=ProductionEnvironment=DOTNET_PRINT_TELEMETRY_MESSAGE=false[Install]WantedBy=multi-user.target
啟動(dòng)服務(wù)
systemctl start website
systemctl enable website
測(cè)試站點(diǎn)
curl localhost:8010
安裝Nginx
yum install -y nginx
啟動(dòng),測(cè)試
systemctl start nginx
nginx -v
修改配置文件
cd /etc/nginx
vi /etc/nginx/conf.d/vhost_website.conf