Skip to content

Commit

Permalink
Support unix sockets as server address (fix #617) (#618)
Browse files Browse the repository at this point in the history
  • Loading branch information
raphink authored Apr 10, 2019
1 parent 0ec3014 commit bafac69
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lenses/nginx.aug
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@ let simple =
(* View: server
A simple server entry *)
let server =
[ Util.indent . label "@server" . Util.del_str "server"
. [ Sep.space . label "@address" . store word ]
let address = /[A-Za-z0-9_.:\/-]+/
in [ Util.indent . label "@server" . Util.del_str "server"
. [ Sep.space . label "@address" . store address ]
. [ Sep.space . key word . (Sep.equal . store word)? ]*
. Sep.semicolon
. (Util.eol|Util.comment_eol) ]
Expand Down
9 changes: 9 additions & 0 deletions lenses/tests/test_nginx.aug
Original file line number Diff line number Diff line change
Expand Up @@ -288,3 +288,12 @@ test lns get "location /foo {
{ "root" = "/var/www/html" }
{ "internal"
{ "#comment" = "only valid in location blocks" } } }

test lns get "upstream php-handler {
server unix:/var/run/php/php7.3-fpm.sock;
}\n" =
{ "upstream"
{ "#name" = "php-handler" }
{ "@server"
{ "@address" = "unix:/var/run/php/php7.3-fpm.sock" } } }

0 comments on commit bafac69

Please sign in to comment.