yum install nginx
y
跑起服务
nginx
cat /etc/nginx/nginx.conf
server root
/home/wwwroot/book-mgr/book/book-mgr-be/public
重启
nginx -s reload
root /home/wwwroot/book-mgr/book/book-mgr-fe/dist;
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
location = / {
root /home/wwwroot/book-mgr/book/book-mgr-fe/dist;
index index.html;
}
location ~ .*\.(gif|png|jpg|jpeg|ico|js|css|html)$ {
root /home/wwwroot/book-mgr/book/book-mgr-fe/dist;
}
location / {
proxy_pass http://127.0.0.1:3000;
}

该博客介绍了如何在Linux环境中使用yum安装Nginx,配置服务器根目录为/home/wwwroot/book-mgr/book/book-mgr-be/public,并设置重载配置。详细展示了Nginx的配置文件内容,包括静态资源路径、默认服务器块以及反向代理到本地3000端口的设置。
982

被折叠的 条评论
为什么被折叠?



