-
Notifications
You must be signed in to change notification settings - Fork 324
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix nginx duplicate server name warnings in certain cases.
If the api-umbrella.yml config manually defined a wildcard host, then two hosts could end up defined for the wildcard server name ("_"). This cleans up the implementation a bit, and prevents this duplicate server name warning. This doesn't actually change the existing behavior, so there's still some certain configuration situations that might not really make sense (non-default wildcards), but we'll keep everything defined as-is to match the hosts config.
- Loading branch information
Showing
4 changed files
with
189 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
class LogTail | ||
def initialize(filename) | ||
@path = File.join($config["log_dir"], filename) | ||
File.open(@path) do |file| | ||
file.seek(0, IO::SEEK_END) | ||
@pos = file.pos | ||
end | ||
end | ||
|
||
def read | ||
output = nil | ||
File.open(@path) do |file| | ||
file.seek(@pos) | ||
output = file.read | ||
@pos = file.pos | ||
end | ||
|
||
output | ||
end | ||
end |