Comments (12)
@hillelcoren @lalop I solved it! You needed to add fastcgi_param HTTPS 1;
to you NGINX config. Mine complete config is like this now:
user www-data;
events {
worker_connections 768;
}
http {
upstream backend {
server app:9000;
}
include /etc/nginx/mime.types;
default_type application/octet-stream;
gzip on;
gzip_disable "msie6";
server {
listen 80 default;
server_name your_ininja_site;
root /var/www/app/public;
index index.php;
charset utf-8;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
sendfile off;
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass backend;
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_param HTTPS 1;
fastcgi_buffers 4 16k;
}
location ~ /\.ht {
deny all;
}
}
}
Just replace the on in the repo with this one and you're good to go, in case anyone else has the same issue!
Source (my answer was based on a Laravel-related question): http://stackoverflow.com/a/34121082
from dockerfiles.
@hillelcoren I think so because I set the env variable to REQUIRE_HTTPS=true
and APP_URL=https://invoice.domain.xx
. However, I use a rancher with a rancher load balancer and letsencrypt and the load balancer forwarded to a nginx server with fold configs:
user www-data;
events {
worker_connections 768;
}
http {
upstream backend {
server invoiceninja:9000;
}
include /etc/nginx/mime.types;
default_type application/octet-stream;
gzip on;
gzip_disable "msie6";
server {
listen 80 default;
server_name your_ininja_site;
root /var/www/app/public;
index index.php;
charset utf-8;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
sendfile off;
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass backend;
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_param HTTPS 1;
fastcgi_buffers 4 16k;
}
location ~ /\.ht {
deny all;
}
}
}
Could that be the problem?
from dockerfiles.
can you try to set the APP_URL env var with https ?
from dockerfiles.
@lalop nothing unfortunately :(
I tried like this (both with https and https://domain.xx):
app:
image: invoiceninja/invoiceninja
environment:
- DB_USERNAME=root
- DB_PASSWORD=legaal
- APP_URL=https
from dockerfiles.
@hillelcoren do you know how to set invoice ninja to handle https ?
from dockerfiles.
If you're using a proxy you may need to set TRUSTED_PROXIES
https://github.com/invoiceninja/invoiceninja/blob/master/app/Http/Middleware/StartupCheck.php#L32
from dockerfiles.
@hillelcoren Thanks I'll try that. Sorry for late reply was at a hackathon :)
I've a bit of issues figuring out what to put in TRUSTED_PROXIES, but I'll get there.
from dockerfiles.
Thank you for posting this, it helped a lot.
from dockerfiles.
Hi there,
I have the same problem and I set the ```fastcgi_param HTTPS 1;`` but the server does not find the asset.
What could be the reason for this?
from dockerfiles.
Does the app work without SSL?
from dockerfiles.
Have you set TRUSTED_PROXIES in the .env file
http://docs.invoiceninja.com/en/latest/configure.html#using-a-proxy
from dockerfiles.
Link to doc is a 404 page. This might be what people are looking for
https://invoice-ninja.readthedocs.io/en/latest/configure.html#using-a-reverse-proxy
Incase the docs get moved again they state for 4.5.37
use
TRUSTED_PROXIES='10.0.0.0/8,172.16.0.0/12,192.168.0.0/16'
from dockerfiles.
Related Issues (20)
- Built in database HOT 3
- Problem with MySQL Docker: base image of `mysql:8` is now Oracle based HOT 2
- 500 - Server Error Back <localhost>
- Installation for InvoiceNinja 4.5 HOT 2
- Question: How to run PHP commands? HOT 1
- Add Traefik examples HOT 6
- Missed mariadb-connector-c-dev package
- Podman - Premissions issue, unable to create directory HOT 1
- Get Invoiceninja running on TrueNAS Scale
- getting access denied after modifying docker-compose.yml
- Helm chart: Secret name for tls cert is not configurable
- after update black page and nothing happen HOT 7
- Brand new stack won't talk to the mysqldb HOT 1
- Recent docker builds are failing due to composer.lock changes HOT 3
- Update php to fix CVE's HOT 1
- The APP_KEY generation failing on latest version. v5.6.15 HOT 1
- Container ignores DB_TYPE HOT 1
- [Suggestion] Fix Security Gaps in Helm Chart
- Could not open input file: artisan HOT 1
- Grey screen after successful setup
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dockerfiles.