Comments (15)
With REQUIRE_HTTPS=true
I'm getting a "too many redirects".
I'm not sure yet what is redirecting so often. I will have a look into this later!
from dockerfiles.
Maybe this will help:
https://www.invoiceninja.com/forums/topic/ssl-too-many-redirects/#post-8578
Also, you may need to configure the trusted proxies:
http://docs.invoiceninja.com/en/latest/configure.html#using-a-proxy
from dockerfiles.
hey @SinoBoeckmann maybe you should add your proxy as a trusted one https://github.com/invoiceninja/invoiceninja/blob/master/.env.example#L36
from dockerfiles.
@Mzngit This is just a "normal" nginx/ "vhost" configuration:
Here is in full grace:
# 1. force the website to be https
server {
listen 80;
listen [::]:80;
server_name domain.name;
return 301 https://domain.name$uri$is_args$args;
}
# 2. the actual config with the proxy
server {
listen 443 ssl;
listen [::]:443 ssl;
ssl_certificate /etc/letsencrypt/live/domain.name/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/domain.name/privkey.pem;
server_name domain.name;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# Fix the βIt appears that your reverse proxy set up is broken" error.
proxy_pass http://127.0.0.1:8858;
proxy_read_timeout 90;
#proxy_redirect http://localhost:8858 https://domain.name;
}
}
Within this config it is working well.
But there are some other issues with this docker repo here and the Dockerfile!
I will open a pull request later this week with some fixes to the system. :)
from dockerfiles.
The APP_URL value is only used in cases where the site is accessed without a browser. ie, when running artisan console commands.
from dockerfiles.
Okay!
And why is the URL then "hardcoded/ hardlinked" in the markup and not just relative to the domain?
Is there a way to change this? Or at least to change it once to another domain name?
from dockerfiles.
Sorry, I'm not sure how to change this. It's probably related to using a proxy.
from dockerfiles.
So... I got it. Somehow.
I needed to add the following lines to my proxy_pass in nginx (host)
proxy_redirect off; proxy_set_header Host $Host
But then I had the problem, that internally in laraval/ symfony the asset-method still get me http links instead of https so unfortunately I needed to change the routes/web.php and add
if (env('APP_ENV') === 'production') { URL::forceSchema('https'); }
on top of this file.
(https://laracasts.com/discuss/channels/laravel/how-i-can-force-all-my-routes-to-be-https-not-http?page=1)
Maybe, it is possible to add this URL::forceSchema('https');
to the repo of invoiceninja if the checkbox (use ssl/tls) is checked in the invoiceninja setup progress!
from dockerfiles.
Thanks for sharing the solution!
You can add REQUIRE_HTTPS=true
to the .env file to require HTTPS
from dockerfiles.
@hillelcoren
It is this file:44 that causes the redirects... but I'm not sure why and nor I'm that into Symfony/ Laravel to know where Redirect::secure is come form.
from dockerfiles.
I will have a look into that urls... but beside that. Even when I remove this trigger the internal links are not delivered as https as like URL::forceSchema('https');
does!
from dockerfiles.
Yes, that's the relevant code.
Not sure...
from dockerfiles.
@SinoBoeckmann For those of us who are newbies, where in the nginx.conf file is your line (prox redirect) line get added?
Also, do you think it has any relevance to the problem in issue #62 relating to Upgrade?
Thanks.
from dockerfiles.
Ah ... and @lalop. I tried the trusted proxy config as you mentioned. But this wasn't working either.
There is something in this case that I'm missing and I will figure it out! :)
from dockerfiles.
@SinoBoeckmann did you find any explanation ?
from dockerfiles.
Related Issues (20)
- XMLHttpRequest error when requesting PDF files - after migrating between servers HOT 3
- QUEUE_CONNECTION configuration in Docker - can't find clear answer. HOT 1
- not opening login page
- Unable to view / print / download PDF invoices in docker HOT 11
- [BUG] Docker selfhosted bug HOT 8
- Connection reset by peer error with docker install HOT 2
- Raspberry Pi DB Error HOT 4
- dockerhub page says port 80 is opened, but it's port 9000 fcgi that is opened HOT 11
- Docker in k8s, testing, slow initial page load (including page refresh) HOT 15
- Tax line item not displaying in Totals area of invoice HOT 2
- after upgrade empty white page HOT 2
- Blank screen after upgrade HOT 5
- Permissions Error with Lost+Found Directory HOT 2
- git clone not pulling latest version HOT 6
- Update helm image? HOT 2
- Container startup only works with bind mount; `cp: can't create directory '/var/www/app/storage/app': Permission denied` HOT 5
- Http links requested when visiting a https page HOT 1
- Helm Chart commonLabels vs podLabels
- Database Availability Race Condition during Intialisation
- <user experience> High complexity for a single person small business. HOT 5
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.