Skip to content

Firefly III: a personal finances manager

Update some code for Heroku.

James Colee3e8336602b8
diff --git a/.env.heroku b/.env.heroku
index 55237bd98b..13de7aa0b4 100644
--- a/.env.heroku
+++ b/.env.heroku
@@ -36,7 +36,7 @@ DB_CONNECTION=pgsql
# 'daily' is the default logging mode giving you 5 daily rotated log files in /storage/logs/.
# Several other options exist. You can use 'single' for one big fat error log (not recommended).
# Also available are 'syslog' and 'errorlog' which will log to the system itself.
-APP_LOG=errorlog
+APP_LOG=syslog
# Log level. You can set this from least severe to most severe:
# debug, info, notice, warning, error, critical, alert, emergency
diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php
index 30247d8ee0..d91edc80e3 100644
--- a/app/Providers/AppServiceProvider.php
+++ b/app/Providers/AppServiceProvider.php
@@ -25,7 +25,7 @@ namespace FireflyIII\Providers;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\ServiceProvider;
use Laravel\Passport\Passport;
-
+use URL;
/**
* @codeCoverageIgnore
* Class AppServiceProvider.
@@ -38,6 +38,9 @@ class AppServiceProvider extends ServiceProvider
public function boot(): void
{
Schema::defaultStringLength(191);
+ if('heroku' === env('APP_ENV')) {
+ URL::forceScheme('https');
+ }
}
/**
diff --git a/nginx_app.conf b/nginx_app.conf
index 97bdb62378..39dedf0155 100644
--- a/nginx_app.conf
+++ b/nginx_app.conf
@@ -2,6 +2,9 @@
fastcgi_param HTTP_PROXY "";
location / {
+ if ($http_x_forwarded_proto != "https") {
+ return 301 https://$host$request_uri;
+ }
# try to serve file directly, fallback to rewrite
try_files $uri @rewriteapp;
}