Git Product home page Git Product logo

Comments (12)

peterwilli avatar peterwilli commented on June 24, 2024 10

@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.

snics avatar snics commented on June 24, 2024 1

@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.

lalop avatar lalop commented on June 24, 2024

can you try to set the APP_URL env var with https ?

from dockerfiles.

peterwilli avatar peterwilli commented on June 24, 2024

@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.

lalop avatar lalop commented on June 24, 2024

@hillelcoren do you know how to set invoice ninja to handle https ?

from dockerfiles.

hillelcoren avatar hillelcoren commented on June 24, 2024

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.

peterwilli avatar peterwilli commented on June 24, 2024

@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.

cinemast avatar cinemast commented on June 24, 2024

Thank you for posting this, it helped a lot.

from dockerfiles.

snics avatar snics commented on June 24, 2024

Hi there,

I have the same problem and I set the ```fastcgi_param HTTPS 1;`` but the server does not find the asset.
screen shot 2017-08-18 at 10 44 57

What could be the reason for this?

from dockerfiles.

hillelcoren avatar hillelcoren commented on June 24, 2024

Does the app work without SSL?

from dockerfiles.

hillelcoren avatar hillelcoren commented on June 24, 2024

Have you set TRUSTED_PROXIES in the .env file

http://docs.invoiceninja.com/en/latest/configure.html#using-a-proxy

from dockerfiles.

chrisskeddy avatar chrisskeddy commented on June 24, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.