Blog.Core .Net Core 权限管理应用

文档地址:http://apk.neters.club/.doc/guide

2022-04-13 使用宝塔面板搭建该应用。

要点:

  1. 如果改用MySQL数据库,需要使用数据库root账户,不需要事先创建数据库,根据连接字符串的Database会自动创建数据库并填充初始数据。
  2. 使用Blog.Core.Publish.bat 创建出PublishFile之后将文件复制到宝塔wwwroot下新建的文件夹里面,然后使用supervisor创建守护进程,初始化代码:dotnet /www/wwwroot/****/Blog.Core.Api.dll
  3. 配套的Blog.Admin 使用npm run build出网站文件并上传到/www/wwwroot/任意新建一个目录下。
  4. 在面板中用域名创建一个静态网站,并在Config中填写:server {
    listen 80;
    listen [::]:80;
    server_name 域名;

    #charset koi8-r;
    #access_log /var/log/nginx/host.access.log main;

    location / {
    try_files $uri $uri/ /index.html;
    root /www/wwwroot/***Blog.Admin build文件地址;
    index index.html index.htm;
    }

    location /api/ {
    include uwsgi_params;
    proxy_pass http://域名:9291;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }

    location /api2/ {
    include uwsgi_params;
    proxy_pass http://域名:9291;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection “upgrade”;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }

    location /images/ {
    include uwsgi_params;
    proxy_pass http://域名:9291;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }

    #error_page 404 /404.html;

    # redirect server error pages to the static page /50x.html
    #
    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
    root /usr/share/nginx/html;
    }

    # proxy the PHP scripts to Apache listening on 127.0.0.1:80
    #
    #location ~ \.php$ {
    # proxy_pass http://127.0.0.1;
    #}

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    #
    #location ~ \.php$ {
    # root html;
    # fastcgi_pass 127.0.0.1:9000;
    # fastcgi_index index.php;
    # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
    # include fastcgi_params;
    #}

    # deny access to .htaccess files, if Apache’s document root
    # concurs with nginx’s one
    #
    #location ~ /\.ht {
    # deny all;
    #}
    }

 

给TA打赏
共{{data.count}}人
人已打赏
C#

C# 解决 “请求被中止: 未能创建 SSL/TLS 安全通道”的问题

2020-8-7 14:23:29

WooCommerce

Woocommerce Open Close 插件修改24小时格式

2020-10-16 14:28:13

各类网站开发

站长微信 710 342 444 或者扫一扫右侧二维码。
    0 条回复 A文章作者 M管理员
      暂无讨论,说说你的看法吧
    个人中心
    购物车
    优惠劵
    今日签到
    有新私信 私信列表
    搜索