>> Deploy

Use Nginx to host FlowCore 2.0 on Linux

how to install ASP.NET Core 6.0 on Linux
Depending on the Linux distribution you are using, please refer to the official Microsoft documentation to execute the installation command.
install the .NET SDK or .NET runtime on Ubuntu

(1)Configure the Kestrel web server.
1.1 Configure Kestrel binding native ports.
Open the </runroot/appsettings.json> you can see that Kestrel binds the local address and port by default <localhost:5000>.
localhost equals and uses Kestrel to bind native addresses and ports, which can be used with reverse proxies (Nginx, Apache).
You can customize the port that Kestrel binds (recommended port range 5000-60000) as long as the port is not occupied.
"Kestrel": {
    "Endpoints": {
      "Http": {
        "Url": "http://localhost:5000"

1.2 Verify that Kestrel is working correctly.
Start the Kestrel web server in the Linux commands line.
Linux commands
sudo dotnet /FlowCoreApproot/runroot/FlowCore.dll

Test HTTP access to the Kestrel web server.
Linux commands
curl http://localhost:5000

1.3 Configure the Linux background service<flowcore.service>. Copy <runroot/flowcore.service> to </etc/systemd/system>.
Linux commands
sudo cp /FlowCoreApproot/runroot/flowcore.service /etc/systemd/system

Use <vim > edit <flowcore.service> and change the deployment path </FlowCoreApproot> to the actual deployment path.
Linux commands
sudo vim /FlowCoreApproot/runroot/flowcore.service

ExecStart=/usr/bin/dotnet /FlowCoreApproot/runroot/FlowCore.dll



1.4 Start the service <flowcore.service>.
Install the service
Linux commands
sudo systemctl enable /etc/systemd/system/flowcore.service

Start the service
Linux commands
sudo systemctl start flowcore

Stop the service
Linux commands
sudo systemctl stop flowcore

View service status
Linux commands
sudo systemctl status flowcore

(2)Install Nginx
Install Nginx
Linux commands
sudo apt update
sudo apt install nginx

First boot Nginx
sudo service nginx start

Start Nginx
sudo systemctl start nginx

Reboot Nginx
sudo systemctl restart nginx

Stop Nginx
sudo systemctl stop nginx

View the Nginx service status
Linux commands
sudo systemctl status nginx

(3) Configure the NGINX reverse proxy
3.1 Configure the Nginx reverse proxy to forward external HTTP requests to Kestrel.
Edit the nginx configuration file </etc/nginx/sites-available/default> using <vim>.
using vim edit the nginx configuration file
sudo vim /etc/nginx/sites-available/default

In the following configuration, Nginx forwards the matching request to the Kestrel listening address <>.
server {
    listen 80;
    listen 443 ssl;
    ssl_certificate     /etc/nginx/office.paicore.com.crt;
    ssl_certificate_key     /etc/nginx/office.paicore.com.key;
    server_name     office.paicore.com;

    location / {
        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;
        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header   X-Forwarded-Proto $scheme;

3.2 Configure Nginx file upload limits.
Nginx supports uploading files up to 1M by default.
Use <vim > to open </etc/nginx/nginx.conf> and add the following code.
Please configure the file upload limit according to your actual needs.
http {
    client_max_body_size 200M;

server {
    client_max_body_size 200M;

© 2023 PaiCore LLC. or its affiliates. All rights reserved.