Add custom NGINX logs #32
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #31
Description
This add two custom NGINX access logs:
access_archive.log)remote_addr_anon)access_debug.log)remote_addr)realip_remote_addr)This PR also includes support for setting the real client IP (instead of the Cloudflare IP) and a script to allow us to update the Cloudflare IPs.
Please also evaluate the decisions made. For example:
Other information
access_archive.logEntry example:
{"time_iso8601":"2020-02-27T21:16:49+00:00", "remote_addr_anon":"104.35.248.0", "request_method":"GET", "request_uri":"/licenses/by/4.0/?1582838209", "status":"200", "http_referer":"", "http_user_agent":"HTTPie/0.9.4"}Formatted/linted:
{ "time_iso8601": "2020-02-27T21:16:49+00:00", "remote_addr_anon": "104.35.248.0", "request_method": "GET", "request_uri": "/licenses/by/4.0/?1582838209", "status": "200", "http_referer": "", "http_user_agent": "HTTPie/0.9.4" }access_debug.log{"time_iso8601":"2020-02-27T21:16:49+00:00", "msec":"1582838209.620", "request_time":"0.011", "request_method":"GET", "request_uri":"/licenses/by/4.0/?1582838209", "status":"200", "body_bytes_sent":"10944", "http_referer":"", "proxy_host":"10.22.11.12", "proxy_port":"80", "upstream_http_server":"Apache", "upstream_connect_time":"0.000", "upstream_header_time":"0.008", "upstream_response_time":"0.008", "realip_remote_addr":"172.69.33.45", "remote_addr":"[REDACTED]", "http_user_agent":"HTTPie/0.9.4"}Formatted/linted:
{ "time_iso8601": "2020-02-27T21:16:49+00:00", "msec": "1582838209.620", "request_time": "0.011", "request_method": "GET", "request_uri": "/licenses/by/4.0/?1582838209", "status": "200", "body_bytes_sent": "10944", "http_referer": "", "proxy_host": "10.22.11.12", "proxy_port": "80", "upstream_http_server": "Apache", "upstream_connect_time": "0.000", "upstream_header_time": "0.008", "upstream_response_time": "0.008", "realip_remote_addr": "172.69.33.45", "remote_addr": "[REDACTED]", "http_user_agent": "HTTPie/0.9.4" }Checklist
Update index.md).masterbranch of the repository.visible errors.
Developer Certificate of Origin