antpro
-
AntDesign通过Nginx访问后端API的配置参考
123456789101112131415161718192021server {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;}}