Skip to content

Instantly share code, notes, and snippets.

@renesansz
Created December 7, 2018 03:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save renesansz/7e91d4551b13ea3a70f0b8ba3b567053 to your computer and use it in GitHub Desktop.
Save renesansz/7e91d4551b13ea3a70f0b8ba3b567053 to your computer and use it in GitHub Desktop.
Apache Virtual Host Config
# Default - Block direct IP access
<VirtualHost your-ip-address:80>
ServerName your-ip-address
Redirect 403 /
ErrorDocument 403 "Sorry, direct IP access not allowed."
UseCanonicalName Off
</VirtualHost>
# Include HTTPS
<VirtualHost your-ip-address:443>
ServerName your-ip-address
Redirect 403 /
ErrorDocument 403 "Sorry, direct IP access not allowed."
UseCanonicalName Off
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment