1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
server { server_name www.test.com;#域名 root G:/dist; #文件夹路径 location / { # 用于配合 browserHistory使用 try_files $uri $uri/ /index.html; # 如果有资源,建议使用 https + http2,配合按需加载可以获得更好的体验 # rewrite ^/(.*)$ https://preview.pro.ant.design/$1 permanent; } location /api { #反向代理 如果请求的使api就代理到 修改为自己api的域名 proxy_pass https://preview.pro.ant.design; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; } } |
本文作者: GavinDong
版权属于: GavinDong博客
文章链接: https://gavindong.com/2752.html
如果使用过程中遇到问题,可 **点击此处** 交流沟通。
版权所有,转载时必须以链接形式注明作者和原始出处及本声明。