世界上最伟大的投资就是投资自己的教育

全场限时 5 折

happylb


id 22069


happylb 6 hours 31 minutes 43 seconds 执事 研究生


邀请人:随风 · 练气


  • 线上服务器部署(前后端)视频教程

    观看前后端分离部署视频,按照其方式部署问题
    http://gm.lbtestym.com 前端返回 404
    http://gm.lbtestym.com/api 访问后端返回正常

    nginx server 配置如下

    server {
    listen 80;
    server_name gm.lbtestym.com;
    root /root/shsj/gm/client/build;
    index index.html index.htm;
    # Routes without file extension e.g. /user/1
    location / {
    try_files $uri /index.html;
    }
    # 404 if a file is requested (so the main app isn't served)
    location ~ .+..+$ {
    try_files $uri =404;
    }
    # OPTIONAL: For an API server you want to proxy
    location /api {
    proxy_pass http://localhost:8300;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection ‘upgrade’;
    proxy_set_header Host $host;
    proxy_cache_bypass $http_upgrade;
    }
    }
    貌似访问http://gm.lbtestym.com 时,并未进入

    location / {
    try_files $uri /index.html;
    }
    而是进入 location ~ .+..+$ {
    try_files $uri =404;
    }

© 汕尾市求知科技有限公司 | Rails365 Gitlab | Qiuzhi99 Gitlab | 知乎 | b 站 | 搜索

粤公网安备 44152102000088号粤公网安备 44152102000088号 | 粤ICP备19038915号

Top