I want to direct the users to different web services with nginx configuration.
The scenario is for the internal users with host name from 192.168.1.1
to 192.168.1.255
I want to serve them some web service but for the other external visitor I don't want this to be realised.
I know I could use IP_TABLES
to enable this feature, but I use IP_TABLE rules mainly for firewall purpose, I don't want to mix it with this configuration.
Is there any configuration available to me in the nginx.conf
?
You can use the GEO module together with a map directive:
Create a separate
location
block that covers your sensitive content.Keep in mind that configuration directives don't inherit; you'll need to include in the new block anything that's in the existing `location that's needed for your content.