Invoiceninja: Unable to Run InvoiceNinja Over HTTPS With Traefik

Created on 12 Oct 2018  路  4Comments  路  Source: invoiceninja/invoiceninja

I have Invoice Ninja running in a Docker container, managed with Rancher, and am able to access the site over my local network using the local IP address and container port, but when running it through Traefik, MOST of the site loads over HTTP, while the vast majority of the site does NOT load over HTTPS.

Rancher Compose:

version: '2'
services:
app:
image: invoiceninja/invoiceninja:latest
dns:
- 1.1.1.1
- 1.0.0.1
labels:
io.rancher.container.pull_image: always
{{- if (.Values.HOST_LABEL)}}
io.rancher.scheduler.affinity:host_label: ${HOST_LABEL}
{{- end}}
links:
- mysql
restart: on-failure
volumes:
- /RancherCattleConfig/${DATA_DIR}/.env:/var/www/app/.env
- /RancherCattleData/${DATA_DIR}/Logo:/var/www/app/public/logo
- /RancherCattleData/${DATA_DIR}/Storage:/var/www/app/storage
cron:
image: invoiceninja/invoiceninja:latest
dns:
- 1.1.1.1
- 1.0.0.1
entrypoint: |
bash -c 'bash -s <<EOF
trap "break;exit" SIGHUP SIGINT SIGTERM
sleep 300s
while /bin/true; do
./artisan ninja:send-invoices
./artisan ninja:send-reminders
sleep 1d
done
EOF'
labels:
io.rancher.container.pull_image: always
{{- if .Values.HOST_LABEL}}
io.rancher.scheduler.affinity:host_label: ${HOST_LABEL}
{{- end}}
links:
- mysql
restart: on-failure
volumes_from:
- app
mysql:
image: mysql:5
dns:
- 1.1.1.1
- 1.0.0.1
environment:
MYSQL_DATABASE: ninja_db
MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASS}
MYSQL_USER: ninja
MYSQL_PASSWORD: ${DB_USER_PASS}
labels:
io.rancher.container.pull_image: always
{{- if .Values.HOST_LABEL}}
io.rancher.scheduler.affinity:host_label: ${HOST_LABEL}
{{- end}}
traefik.enable: false
restart: on-failure
volumes:
- /RancherCattleData/${DATA_DIR}/Database:/var/lib/mysql
web:
image: nginx
dns:
- 1.1.1.1
- 1.0.0.1
labels:
io.rancher.container.pull_image: always
{{- if .Values.HOST_LABEL}}
io.rancher.scheduler.affinity:host_label: ${HOST_LABEL}
{{- end}}
{{- if .Values.TRAEFIK_HOST}}
traefik.enable: true
traefik.frontend.rule: Host:${TRAEFIK_HOST}
traefik.frontend.entryPoints: http,https
traefik.frontend.headers.forceSTSHeader: false
traefik.frontend.headers.SSLRedirect: false
traefik.frontend.passHostHeader: true
traefik.port: "80"
{{- else}}
traefik.enable: false
{{- end}}
io.rancher.sidekicks: app, cron
links:
- app
networks:
- public-proxy
ports:
- "${WEB_PORT}:80"
restart: on-failure
volumes:
- /RancherCattleConfig/${DATA_DIR}/nginx.conf:/etc/nginx/nginx.conf:ro
volumes_from:
- app
networks:
public-proxy:
external: true

Over HTTP: (None of the Font Awesome icons are loading, but most everything else does)

screenshot_2018-10-11 invoice ninja-http

Over HTTPS:

screenshot_2018-10-11 invoice ninja-https

Anyone know what the issue might be, or some things I could try?

Thank you!

compatibility

Most helpful comment

@WilliamMiceli Try changing the nginx config of the app and adding the following line:
fastcgi_param HTTPS 1; inside the default location block.

All 4 comments

have a look at the console output, it will tell you which resources are not loading.

2018-10-11 21_25_41-window

It shows mainly blocked http requests, but I'm not sure why when I have https:// declared in my environment variables

@WilliamMiceli Try changing the nginx config of the app and adding the following line:
fastcgi_param HTTPS 1; inside the default location block.

That worked perfectly!
Thank you so much @anojht !

I'm off to setup emailing and then buy a whitelabel for Invoice Ninja!
Absolutely love using this!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Braunson picture Braunson  路  4Comments

popindavibe picture popindavibe  路  5Comments

pthoelken picture pthoelken  路  4Comments

smcpeck picture smcpeck  路  3Comments

gerroon picture gerroon  路  4Comments