-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1396 from aligent/feature/DO-1704-nginx-for-mesh
DO-1704: add nginx to the mesh
- Loading branch information
Showing
4 changed files
with
153 additions
and
40 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
FROM nginx:stable-alpine | ||
|
||
COPY nginx.conf /etc/nginx/nginx.conf |
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,53 @@ | ||
events { | ||
worker_connections 1024; | ||
} | ||
|
||
http { | ||
log_format json_combined escape=json | ||
'{' | ||
'"time_local":"$time_local",' | ||
'"remote_addr":"$remote_addr",' | ||
'"remote_user":"$remote_user",' | ||
'"request":"$request",' | ||
'"status": "$status",' | ||
'"body_bytes_sent":"$body_bytes_sent",' | ||
'"request_time":"$request_time",' | ||
'"http_referer":"$http_referer",' | ||
'"http_user_agent":"$http_user_agent"' | ||
'}'; | ||
|
||
gzip on; | ||
gzip_proxied any; | ||
gzip_types text/plain application/json; | ||
gzip_min_length 1000; | ||
|
||
server { | ||
listen 80; | ||
access_log /var/log/nginx/access.log json_combined; | ||
|
||
location /graphql { | ||
# Reject requests with unsupported HTTP method | ||
if ($request_method !~ ^(GET|POST|HEAD|OPTIONS|PUT|DELETE)$) { | ||
return 405; | ||
} | ||
|
||
# Only requests matching the expectations will | ||
# get sent to the application server | ||
proxy_pass http://localhost:4000; | ||
proxy_http_version 1.1; | ||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Connection 'upgrade'; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_cache_bypass $http_upgrade; | ||
} | ||
|
||
location /healthcheck { | ||
return 200; | ||
} | ||
|
||
location / { | ||
return 403; | ||
} | ||
} | ||
} |
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