Skip to content

Commit

Permalink
Update some code for Heroku.
Browse files Browse the repository at this point in the history
  • Loading branch information
JC5 committed Aug 1, 2018
1 parent 194073e commit e3e8336
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .env.heroku
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\ServiceProvider;
use Laravel\Passport\Passport;

use URL;
/**
* @codeCoverageIgnore
* Class AppServiceProvider.
Expand All @@ -38,6 +38,9 @@ class AppServiceProvider extends ServiceProvider
public function boot(): void
{
Schema::defaultStringLength(191);
if('heroku' === env('APP_ENV')) {
URL::forceScheme('https');
}
}

/**
Expand Down
3 changes: 3 additions & 0 deletions nginx_app.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit e3e8336

Please sign in to comment.