I am currently trying to run both a Nuxt.js frontend app and Kirby as a backend app on the same Digital Ocean droplet. To achieve this I am using Nginx to serve the app on localhost:8000 and proxy all requests to url.com/cms to localhost:8080.
I’ve set up Apache to run on port 8080. I’ve also set up a virtualhost for url.com and ran a2ensite to connect it.
The actual kirby installation works. I can also fetch my custom api via /api/data, only the panel throws an error.
Does anyone have any idea why? I can’t seem to figure it out. I’ve tried reinstalling the panel as well with no success.
Here is my config:
/etc/nginx/sites-enabled/default
# HTTP — redirect all traffic to HTTPS
server {
listen 80;
listen [::]:80 default_server ipv6only=on;
return 301 https://$host$request_uri;
}
# HTTPS — url.com -> STJB_Frontend
# HTTPS - url.com -> Apache:8080 -> STJB_Backend
server {
# Enable HTTP/2
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name url.com;
# Use the Let’s Encrypt certificates
ssl_certificate /etc/letsencrypt/live/url.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/url.com/privkey.pem;
# Include the SSL configuration from cipherli.st
include snippets/ssl-params.conf;
location /cms {
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_pass http://localhost:8080/;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://localhost:8000/;
proxy_ssl_session_reuse off;
proxy_set_header Host $http_host;
proxy_cache_bypass $http_upgrade;
proxy_redirect off;
}
}
/etc/apache2/sites-available/studiojohannesbissinger.com.conf
<VirtualHost *:8080>
ServerName studiojohannesbissinger.com
ServerAlias www.studiojohannesbissinger.com
DocumentRoot /home/studioscholz/apps/STJB_Backend
<Directory /home/studioscholz/apps/STJB_Backend>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
</Directory>
</VirtualHost>