I am back! ![]()
I have decided that I would try setting up InvoiceNinja on a VPS that I have instead of trying to run it on my QNAP. This way I can utilize things like the client portals, etc. more easily.
I followed the instructions given here:
However, I cannot get InvoiceNinja to load. I get a 500 error. The very first time, I got the default nginx website, but not any longer. Just the 500 error.
Here is my nginx site file:
server {
# NOTE That the 'default_server' option is only necessary if this is your primary domain application.
# If you run multiple subdomains from the same host already, remove the 'default_server' option.
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
server_name billing.justaddsoftware.net;
client_max_body_size 20M;
# This if statement will forcefully redirect any connection attempts to explicitly use the domain name.
# If not, and your DNS doesn't provide IP address protection, accessing the server with direct IP can
# cause glitches with the services provided by the app, that could be security, or usability issues.
if ($host != $server_name) {
return 301 https://$server_name$request_uri;
}
# Here, enter the path to your invoiceninja directory, in the public dir. VERY IMPORTANT
# DO NOT point the root directly at your invoiceninja directory, it MUST point at the public folder
# This is for security reasons.
root /usr/share/nginx/invoiceninja/public;
gzip on;
gzip_types application/javascript application/x-javascript text/javascript text/plain application/xml application/json;
gzip_proxied no-cache no-store private expired auth;
gzip_min_length 1000;
index index.php index.html index.htm;
# Enter the path to your existing ssl certificate file, and certificate private key file
# If you donāt have one yet, you can configure one with openssl in the next step.
ssl_certificate "/etc/letsencrypt/live/billing.justaddsoftware.net/fullchain.pem";
ssl_certificate_key "/etc/letsencrypt/live/billing.justaddsoftware.net/privkey.pem";
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 10m;
ssl_ciphers 'AES128+EECDH:AES128+EDH:!aNULL';
ssl_prefer_server_ciphers on;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
charset utf-8;
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
if (!-e $request_filename) {
rewrite ^(.+)$ /index.php?q= last;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# Here we pass php requests to the php8.3-fpm listen socket.
# PHP errors are often because this value is not correct.
# Verify your php8.3-fpm.sock socket file exists at the below directory
# and that the php8.3-fpm service is running.
fastcgi_pass unix:/run/php/php8.3-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors off;
fastcgi_buffer_size 16k;
fastcgi_buffers 4 16k;
}
location ~ /\.ht {
deny all;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
access_log /var/log/nginx/ininja.access.log;
error_log /var/log/nginx/ininja.error.log;
sendfile off;
}
server {
listen 80;
server_name billing.justaddsoftware.net;
add_header Strict-Transport-Security max-age=2592000;
rewrite ^ https://$server_name$request_uri? permanent;
}
And my .env file. This one is where I get confused a bit. Do I need to use LOCALHOST here or my site name?
APP_NAME="InvoiceNinja"
APP_ENV=production
APP_KEY=base64:RR++y
APP_DEBUG=false
APP_URL=http://localhost
REACT_URL=https://localhost:3001
DB_CONNECTION=mysql
MULTI_DB_ENABLED=false
DB_HOST=localhost
DB_DATABASE=invoicedb
DB_USERNAME=ninja
DB_PASSWORD=***********
DB_PORT=3306
DEMO_MODE=false
BROADCAST_DRIVER=log
LOG_CHANNEL=stack
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120
MAIL_MAILER=smtp
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
POSTMARK_API_TOKEN=
REQUIRE_HTTPS=false
GOOGLE_MAPS_API_KEY=
ERROR_EMAIL=
TRUSTED_PROXIES=
SCOUT_DRIVER=null
NINJA_ENVIRONMENT=selfhost
#options - snappdf / phantom / hosted_ninja
PDF_GENERATOR=hosted_ninja
PHANTOMJS_KEY='a-demo-key-with-low-quota-per-ip-address'
PHANTOMJS_SECRET=secret
UPDATE_SECRET=secret
DELETE_PDF_DAYS=60
DELETE_BACKUP_DAYS=60
COMPOSER_AUTH='{"github-oauth": {"github.com": "${{ secrets.GITHUB_TOKEN }}"}}'
GOOGLE_PLAY_PACKAGE_NAME=
APPSTORE_PASSWORD=
MICROSOFT_CLIENT_ID=
MICROSOFT_CLIENT_SECRET=
MICROSOFT_REDIRECT_URI=
APPLE_CLIENT_ID=
APPLE_CLIENT_SECRET=
APPLE_REDIRECT_URI=
NORDIGEN_SECRET_ID=
NORDIGEN_SECRET_KEY=
GOCARDLESS_CLIENT_ID=
GOCARDLESS_CLIENT_SECRET=
When I run nginx -tit says successful. I get the invoiceninja icon in the browser as well:
![]()
So where am I going wrong? I was hoping I would FINALLY have success hereā¦

