nginx安装、部署前端、请求转发
1、安装可以参考这篇博客
https://www.cnblogs.com/liujuncm5/p/6713784.html
2、部署前端程序
location / { root /var/www/dist; # 前端程序所在路径 index index.html index.htm; # 指定请求的首页html }
3、转发,请关注着色部分
server { listen 80; server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; #部署前端的程序 location / { root /var/www/dist; index index.html index.htm; } #转发使用 location /docs { #将http://132.232.44.72:8080/docs/访问地址转发到 http://132.232.44.72:80/docs/这个地址 proxy_pass http://132.232.44.72:8080/docs/; } #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 html; } }
完毕
相关推荐
liduote 2020-11-13
chenhaotao 2020-11-13
localhost0 2020-11-12
小秋 2020-11-12
lxhuang 2020-11-03
学习web前端 2020-10-27
小焊猪web前端 2020-10-24
杏仁技术站 2020-10-23
南昌千网科技 2020-10-18
liduote 2020-10-16
BlueSkyUSC 2020-10-15
Doniet 2020-10-08
zjutzmh 2020-09-25
PncLogon 2020-09-24
趣IT 2020-09-22
杏仁技术站 2020-09-18
拾光璇旅 2020-09-17
kiven 2020-09-11
lfbooo 2020-09-09