首页 > Web开发 > 详细

Linux服务器部署.Net Core笔记:五、安装Nginx

时间:2019-12-20 01:55:21      阅读:120      评论:0      收藏:0      [点我收藏+]
原文:Linux服务器部署.Net Core笔记:五、安装Nginx

我们搜索一下yum库关于nginx的rpm包:yum list | grep nginx

技术分享图片

找到rpm安装包,我们就可以使用yum直接安装了:yum install nginx

技术分享图片

修改nginx配置文件:vi /etc/nginx/nginx.conf

技术分享图片

注释掉下面的配置:

技术分享图片
#    server {
#        listen       80 default_server;
#        listen       [::]:80 default_server;
#        server_name  _;
#        root         /usr/share/nginx/html;
#
#        # Load configuration files for the default server block.
#        include /etc/nginx/default.d/*.conf;
#
#        location / {
#        }
#
#        error_page 404 /404.html;
#            location = /40x.html {
#        }
#
#        error_page 500 502 503 504 /50x.html;
#            location = /50x.html {
#        }
#    }
技术分享图片

创建一个netcore.conf配置文件:vi /etc/nginx/conf.d/netcore.conf

技术分享图片

添加配置:

server {
    listen 80;
    location / {
        proxy_pass http://localhost:81;
    }
}

启动nginx:systemctl start nginx

技术分享图片

常用命令,重启nginx:

nginx -s reload

 

Linux服务器部署.Net Core笔记:五、安装Nginx

原文:https://www.cnblogs.com/lonelyxmas/p/12070771.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!