It's tedious and error prone to manually test the web server configuration (redirections, cache directives, SSL …) so I've tried to the usual "Test Driven" dance, in Ruby.
The tools in use :
To run the test suite :
- replace
example.com
with your domain in the test files (test/webserver/*_test.rb
) and intest/support/webserver_helper.rb
- execute
bundle exec rake test:webserver
orbundle exec guard
You can set WEBSERVER_ENV
to run the suite against a specific environment. I've been using production (default), staging or development, but you can change/add as many as you want.
If you know in advance how you want your web app and web server to behave (regarding redirections, cache headers, cookies, SSL configuration …) you can prepare you test suite, let it fail and drive your configuration with them.
If you know a better tool or a better way to test those things, I'd be happy to improve.