nginx 部署vue项目配置跨域访问后台接口没有生效

server {
listen 80;
server_name 192.168.0.111;

    #charset koi8-r;

    #access_log  logs/host.access.log  main;

    location / {
        proxy_pass http://localhost:10086/dixin-client/;
        index  index.html index.htm;
    }

location /admin/ {
        proxy_pass http://localhost:10086/dixin-admin/;
        index  index.html index.htm;
    }
    
    
    
    location ~* \.(gif|jpg|jpeg|png|css|js|ico|txt|vue|scss|sass|woff|json|html|jsp|h)$ {
                    proxy_pass http://localhost:10086;
                    proxy_set_header Host $http_host;
                    proxy_set_header X-Real-IP $remote_addr;
                    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
    
    location  ^~ /prod-api/{
            rewrite ^.+prod-api/?(.*)$ /$1 break;
                    proxy_pass http://192.168.0.111:10087/;
                    proxy_set_header Host $http_host;
                    proxy_set_header X-Real-IP $remote_addr;
                    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }

img

img

本地访问 http://192.168.0.111:10087/index.php/prod-api/sys/sms/login 试试.
不是404,就应该是少了个 index.php 的问题