nuxtjs 服务器上部署用的nginx做反向代理。
数据接口用是api.test.com
server {
listen 80;
server_name goletter.cn www.test.cn;
location / {
proxy_pass http://localhost:3333;
}
location ~ ^/api/ {
#rewrite /api/(.+)$ /$1 break;
proxy_pass http://api.test.cn;
proxy_set_header X-Forwarded-For $remote_addr;
}
}
但是前端报错,请求不到数据,是nginx反向代理的问题,请问得怎么配置啊!