Skip to content

Instantly share code, notes, and snippets.

@denmerc
Created February 12, 2018 22:55
Show Gist options
  • Save denmerc/926564d3584fc62c0d32b24368add957 to your computer and use it in GitHub Desktop.
Save denmerc/926564d3584fc62c0d32b24368add957 to your computer and use it in GitHub Desktop.
.net core on linux with linux
# sudo apt-get install nginx
# sudo service nginx start
# /etc/nginx/sites-available/default
server {
listen 80;
location / {
proxy_pass http://localhost:5000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection keep-alive;
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
# sudo nginx -t
# sudo nginx -s reload
# supervisor for restart policy
# sudo apt-get install supervisor
# /etc/supervisor/conf.d/eg.conf
[program:helloworld[
command=/usr/bin/dotnet /var/websites/helloworld/helloworld.dll
directory=/var/websites/helloworld
autostart=true
autorestart=true
stderr_logfile=/var/log/helloworld.err.log
stdout_logfile=/var/log/helloworld.out.log
environment=ASPNETCORE_ENVIRONMENT=Production
user=www-data
stopsignal=INT
# sudo service supervisor stop
# sudo service supervisor start
# sudo -tail -f /var/log/supervisor/supervisord.log
# sudo -tail -f /var/log/helloworld.out.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment