Skip to main content

templates

The template folder, includes all the templates of nginx and systemd service configuration file.

Before deploying the application,we should add the configuration of the nginx and systemd service for apps & apis.

/templates

api-template.service
[Unit]
Description= opsrisk_api-dev
[Service]
WorkingDirectory=/test/test/tets
ExecStart=/usr/bin/dotnet $PATH
Restart=on-failure
# Restart service after 10 seconds if the dotnet service crashes:
RestartSec=1s
SyslogIdentifier=suryaApiTesting
User=surya
Environment=PATH=/var/www/CICD/development/opsriskapi_dev/backup/Surya.OpsRisk.Api.dll
Environment=ASPNETCORE_ENVIRONMENT=Production
Environment=DOTNET_PRINT_TELEMETRY_MESSAGE=false
[Install]
WantedBy=multi-user.target
api-template.conf
location /api-template/ {
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_pass https://localhost:1234;
}