Hey team,
I have a NGINX server with PHP 7.4 running and unfortunately can’t connect to the API:
https://www.theelephant.io/panel/login
Local all fine, but remote server not.
Config file:
<?php
# Kirby Configurations
return [
'panel' =>[
'install' => true],
# Kirby Settings
'debug' => false, # Enable Debug Mode
'home' => 'home', # Change the slug for the homepage
# Markdown Field Configurations
'community.markdown-field.font' => [
'family' => 'sans-serif',
'scaling' => true,
'size' => 'small',
],
'community.markdown-field.modals' => true,
'community.markdown-field.blank' => false,
'community.markdown-field.invisibles' => false
];
Unfortunately I am no expert to config NGINX accordingly, can you pls. help?
Thank you and warm regards
Sebastian
texnixe
2
Hey, welcome to the forum.
I’m not familiar with nginx either, but there are already quite a few configs scattered around the forum, e.g. here: Error 500 on Panel (Nginx, PHP 7.3) - #20 by nikken
Edit: Doesn’t seem to be a specific Nginx problem, I see this error in console
Hi texnixe,
thank you a lot for the fast reply
Might it be due my cloudflare integration - I forgot to mention?
texnixe
4
Hi Texnixe,
I think I have an idea
The problem is, that the API will be triggered without www. and the actual page is running under www.
This leads to the cross origin right?
Can we move the panel from
https://****.io/panel
to
https://www.****.io/panel
I assume then the API will also be triggered under
https://www.****.io/api/system?view=panel
instead
https://****.io/api/system?view=panel
You have to enfore www via your server config.
You could first try if it has any effect if you set your base url in the site/config/config.php
file.
It is strangely not working when I switch to www again, I need to discuss with Cloudflare how to flush the header cache - then this should be solved.
BUT:
Why is the api triggered not under www.?
And: How can I change the base URL and use the same files in the local installation?
Right now I have all files locally - the are pushed to github and from there to the server
Kirby allows you to define different config files per domain, see https://getkirby.com/docs/guide/configuration#multi-environment-setup
I’d assume that’s a problem with your redirect not working for all URLs.
I really appreciate your fast support
Unfortunately it is not working
config.www.theelephant.io.php
<?php
# Kirby Configurations
return [
'url' => 'https://www.theelephant.io',
'panel' =>[
'install' => true],
# Kirby Settings
'debug' => false, # Enable Debug Mode
'home' => 'home', # Change the slug for the homepage
# Markdown Field Configurations
'community.markdown-field.font' => [
'family' => 'sans-serif',
'scaling' => true,
'size' => 'small',
],
'community.markdown-field.modals' => true,
'community.markdown-field.blank' => false,
'community.markdown-field.invisibles' => false
];
Cloudflare has a wildcard forward
Still it tries to use the non-www api call instead of the www - as you can see in the errors
Do you have any idea?