Feature #1313

Allow conditional config based on local IP and port

Added by at2000 504 days ago. Updated 351 days ago.

Status:Need Feedback Start:
Priority:Normal Due date:
Assigned to:jan % Done:

0%

Category:core
Target version:1.5.0
Pending:

No

Resolution:


Description


$HTTP["localip"] == "192.168.0.1" {
  # config that is shared by both HTTP and HTTPS on this interface
}

$HTTP["port"] == "443" {
  # all SSL sites
}

I think we cannot do this using $SERVERsocket without massively duplicating the configs.

History

08/22/2007 05:46 PM - darix

  • Status changed from New to Fixed
  • Resolution set to invalid

you dont have to duplicate stuff. you just put them into a seperate file and use:


include "sharedconfig.conf" 

08/22/2007 06:45 PM - at2000

  • Status changed from Fixed to Need Feedback
  • Resolution deleted (invalid)

OK, you got a valid workaround to avoid duplication of config, but I am not convinced that this is the more preferred way than the features I asked for.

It is common to have some rules shared by both http and https, e.g. both forward to the same fastcgi connection. It is also common to have some rules shared by all https connections, e.g. enabling the ssl backend and implementing those IE and Opera SSL hacks.

Are we satisfied with moving each of these configs to a separate file "as the ultimate solution"?

08/22/2007 10:38 PM - darix

you can do that already
$HTTPhost is evaluate within https hosts too.
sadly it has downsides.

08/23/2007 05:18 AM - at2000

$HTTP[ "host" ] can partly replace $HTTP[ "localip" ], but again we may got different "Host:" headers even on the same interface, most notably being both the IP address and the domain name pointing thereto.

I am not sure how difficult it is to write the code, but from a user point of view I think it is a useful feature, especially it completes the missing pieces in writing conditionals.

01/22/2008 10:17 AM - at2000

The recently added $HTTPscheme is one step forward towards this direction. Users simply want at least (if not more than) one way to achieve their configuration needs, instead of being forced to use hacks.

Also available in: Atom PDF