打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
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

 

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
十二、Docker部署nginx并挂载本地目录到镜像
centos6.5下Zabbix系列之Zabbix安装搭建及汉化
nginx反向代理windows配置之nginx.conf文件配置
YUM安装LNMP架构
使用docker部署Nginx服务器
Zabbix 5.2版本基于LNMP环境安装首发
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服