Skip to content

Commit

Permalink
have docker nginx logs print the client IP
Browse files Browse the repository at this point in the history
  • Loading branch information
joecorall committed Mar 14, 2024
1 parent 95ecba3 commit 1c6361c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crayfish/rootfs/etc/nginx/http.d/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ server {
listen 8000;
root /var/www/html;

# have docker logs show the client IP
real_ip_header X-Forwarded-For;
set_real_ip_from 172.0.0.0/8;

location / {
# try to serve file directly, fallback to index.php
try_files $uri /index.php$is_args$args;
Expand Down
4 changes: 4 additions & 0 deletions drupal/rootfs/etc/nginx/http.d/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
server {
server_name drupal;

# have docker logs show the client IP
real_ip_header X-Forwarded-For;
set_real_ip_from 172.0.0.0/8;

include /etc/nginx/shared/drupal.defaults.conf;
include /etc/nginx/shared/drupal.fpm.conf;
# Required for Nginx service to validate that fpm is working.
Expand Down

0 comments on commit 1c6361c

Please sign in to comment.