Next.js Discord

Discord Forum

Server Action Errors

Answered
Southeastern blueberry bee posted this in #help-forum
Open in Discord
Southeastern blueberry beeOP
my error
`x-forwarded-host` header with value `localhost:3004` does not match `origin` header with value `dashboard.???.???` from a forwarded Server Actions request. Aborting the action.
 ⨯ Error: Invalid Server Actions request.
    at AsyncLocalStorage.run (node:async_hooks:346:14)
    at AsyncLocalStorage.run (node:async_hooks:346:14)




im callinig a function from client to server






'use server'
import axios from 'axios';

export async function checkInformation(username: string, password: string) {
    const response = axios.get(`...`)

    console.log(response)
}
Answered by Ray
I think you need to add your domain to allowedOrigins
View full answer

10 Replies

Southeastern blueberry beeOP
hello again lol @Ray
Southeastern blueberry beeOP
@Ray when im visiting the website from my local machine with my ip in address bar, theres no provlems with that but when im running it on my vps and and accessing the the website from my domain name where im usinig nginx i get that error
Answer
dashboard.???.???
Southeastern blueberry beeOP
alr
Southeastern blueberry beeOP
@Ray how do i set cookies??
@Southeastern blueberry bee <@743561772069421169> how do i set cookies??
you could use cookies() in server action