This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo journalctl -u myapi.service -f |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cd /etc/systemd/system/ | |
| sudo nano myapi.service | |
| [Unit] | |
| Description=My API .NET Web API | |
| [Service] | |
| WorkingDirectory=/var/www/myapi.yoursite.com | |
| ExecStart=/usr/bin/dotnet /var/www/myapi.yoursite.com/MYAPI.API.dll --urls="http://localhost:5253" # Set the URL where your API will run | |
| Restart=always |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo nano backend.yoursite.com | |
| server { | |
| server_name backend.yoursite.com; | |
| location / { | |
| proxy_pass http://localhost:5253; #Replace this ip with your project ip | |
| proxy_set_header Host $host; | |
| proxy_set_header X-Real-IP $remote_addr; | |
| proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo nano example.yoursite.com | |
| server { | |
| server_name example.yoursite.com; | |
| root /var/www/example.yoursite.com; #Replace this path with your project directory | |
| index index.html; | |
| location / { | |
| try_files $uri $uri/ /index.html; | |
| } |