From 7fe7c60963c791ad6f0dc2e9ce261cd46eae62b2 Mon Sep 17 00:00:00 2001 From: Phil Date: Sun, 19 Jan 2025 13:41:44 +0000 Subject: [PATCH] Updated Apache config file so if the service is accessed via the curl command, it wont redirect to the https site and display that the page is being redirected, but will display what is being requested. --- echoip-apache2.conf | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/echoip-apache2.conf b/echoip-apache2.conf index ef9d2d0..9f996eb 100644 --- a/echoip-apache2.conf +++ b/echoip-apache2.conf @@ -11,10 +11,16 @@ # Add support for X-Forwarded-For RequestHeader set X-Forwarded-For "%{REMOTE_ADDR}s" - + # Logging ErrorLog ${APACHE_LOG_DIR}/echoip-error.log CustomLog ${APACHE_LOG_DIR}/echoip-access.log combined + # Enable RewriteEngine + RewriteEngine On + + # Skip redirection if User-Agent contains "curl" + RewriteCond %{HTTP_USER_AGENT} !curl/ [NC] +