Skip to content

Commit

Permalink
[2.x] Fixes NGINX proxy usages (#772)
Browse files Browse the repository at this point in the history
* Fixes `NGINX` proxy usages

* And removes extra message
  • Loading branch information
nunomaduro authored Dec 19, 2023
1 parent 2f1f7d2 commit 9cfbdf4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/Commands/Concerns/InteractsWithIO.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ trait InteractsWithIO
'[INFO] RoadRunner server started; version:',
'[INFO] sdnotify: not notified',
'exiting; byeee!!',
'storage cleaning happened too recently',
];

/**
Expand Down
7 changes: 6 additions & 1 deletion src/Commands/StartFrankenPhpCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ public function handle(ServerProcessInspector $inspector, ServerStateFile $serve
$this->forgetEnvironmentVariables();

$host = $this->option('host');
$port = $this->getPort();

$serverName = $this->option('https')
? "https://$host:$port"
: "http://:$port";

$process = tap(new Process([
$frankenphpBinary,
Expand All @@ -84,7 +89,7 @@ public function handle(ServerProcessInspector $inspector, ServerStateFile $serve
'MAX_REQUESTS' => $this->option('max-requests'),
'CADDY_SERVER_LOG_LEVEL' => $this->option('log-level') ?: (app()->environment('local') ? 'INFO' : 'WARN'),
'CADDY_SERVER_LOGGER' => 'json',
'CADDY_SERVER_SERVER_NAME' => ($this->option('https') ? 'https://' : 'http://')."$host:".$this->getPort(),
'CADDY_SERVER_SERVER_NAME' => $serverName,
'CADDY_SERVER_WORKER_COUNT' => $this->workerCount() ?: '',
'CADDY_SERVER_EXTRA_DIRECTIVES' => $this->buildMercureConfig(),
]));
Expand Down

0 comments on commit 9cfbdf4

Please sign in to comment.