I have a Problem with Reverse_proxy and xenforo api

1. Caddy version (caddy version):

latest

2. How I run Caddy:

as a reverse proxy

a. System environment:

Ubuntu 20.04
Wireguard in conncting the two servers
nginx as main and caddy als RP

b. Command:

I run caddy as systemd daemon on Unbuntu

d. My complete Caddyfile or JSON config:

test.xyz {

    # Set this path to your site's directory.
    #root * /usr/share/caddy

    # Enable the static file server.
    #file_server

    # Another common task is to set up a reverse proxy:
    reverse_proxy http://10.0.0.2:9000

     #header Strict-Transport-Security "max-age=15552000;"
     #header X-Real-IP {http.request.remote}
     #header X-Forwarded-For {http.request.remote}
    # Or serve a PHP site through php-fpm:
    # php_fastcgi localhost:9000

}

Refer to the Caddy docs for more information:

The Caddyfile — Caddy Documentation

3. The problem I’m having:

xenforo has an api and when I have no reverse prox ist will show
{
“errors”: [
{
“code”: “no_api_key_in_request”,
“message”: “Die Anforderung enthielt keinen API-Schl\u00fcssel.”,
“params”: []
}
]
}
and with caddy it comes

Request Page Not Found

This is a customized error page for missing pages.

5. What I already tried:

I have no clue what I can do to fix this issue.

6. Links to relevant resources:

IDK sorry

Hi :slight_smile:

Your config looks good to me :innocent:

Can you check if curl -i -H "Host: test.xyz" http://10.0.0.2:9000 returns the error JSON you shared, or the http/404, please?

2 Likes

curl -i -H “Host: test.xyz” http://10.0.0.2:9000
HTTP/1.1 403 Forbidden
x-litespeed-cache-control: no-cache
x-frame-options: SAMEORIGIN
x-content-type-options: nosniff
last-modified: Fri, 15 Apr 2022 19:01:18 GMT
expires: Thu, 19 Nov 1981 08:52:00 GMT
cache-control: private, no-cache, max-age=0
content-type: text/html; charset=utf-8
set-cookie: xf_csrf=CeRyqzlyK_p7a4p7; path=/
content-length: 40971
date: Fri, 15 Apr 2022 19:01:18 GMT
server: LiteSpeed
connection: Keep-Alive

curl -i -H “Host: anyboard.xyz” http://10.0.0.2:9000
HTTP/1.1 403 Forbidden
x-litespeed-cache-control: no-cache
x-frame-options: SAMEORIGIN
x-content-type-options: nosniff
last-modified: Fri, 15 Apr 2022 19:01:18 GMT
expires: Thu, 19 Nov 1981 08:52:00 GMT
cache-control: private, no-cache, max-age=0
content-type: text/html; charset=utf-8
set-cookie: xf_csrf=CeRyqzlyK_p7a4p7; path=/
content-length: 40971
date: Fri, 15 Apr 2022 19:01:18 GMT
server: LiteSpeed
connection: Keep-Alive

I tried around with different webservers thats why it now says litespeed but both have the same resolde

thanks for the quick reply

I have found the issue it was that I switched from nginx to litespeed
I am such an idiot 100% my bad SORRY

1 Like

No worries! We’re here to help, it’s clear learning has happened so it’s a positive!

1 Like

This topic was automatically closed after 30 days. New replies are no longer allowed.