这是我要访问的路径:
export async function getServerSideProps() {
const url = 'http://127.0.0.1:3000/api/auth/profile/';
const resp = await axios.get(url, {withCredentials: true})
const json = await resp.json()
console.log(json)
return {
props: {}
}
};
这是 next.config.js:
module.exports = {
async rewrites() {
return [
{
source: '/api/auth/:path*',
destination: 'http://127.0.0.1:8000/api/auth/:path*'
},
]
},
}
但它返回了这个:
Server Error
Error [ERR_FR_TOO_MANY_REDIRECTS]: Maximum number of redirects exceeded
我应该怎么办?