当前位置: 移动技术网 > IT编程>开发语言>.net > Linux服务器部署.Net Core笔记:五、安装Nginx

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

2019年12月20日  | 移动技术网IT编程  | 我要评论

刘昱煜,揭纸币藏品骗局,兴盛超市加盟

我们搜索一下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://www.lhsxpumps.com/_localhost:81;
    }
}

启动nginx:systemctl start nginx

常用命令,重启nginx:

nginx -s reload

 

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网