MISC-4: Build custom error pages

Issue Information

Issue Type: Sub-task
Priority: Major
Status: Closed

Reported By:
Ben Tasker
Assigned To:
Ben Tasker
Project: Miscellaneous (MISC)
Resolution: Done (2017-07-06 15:55:32)
Affects Version: Bentasker.co.uk via Tor,
Target version: Bentasker.co.uk via Tor,

Created: 2015-05-19 17:26:24
Time Spent Working
Child of: MISC-2: Make bentasker.co.uk Available as Tor Hidden Service

For any error generated by the reverse proxy at Tor's end, need to create a custom error page detailing useful information (for example, where we block tor2web it'd be helpful to explain why the request has been blocked).

Toggle State Changes


btasker changed status from 'Open' to 'In Progress'
Have configured a basic notification page for tor2web pages, but because NGinx is being a pain, it doesn't really return an appropriate status code. Currently it'll 301 the visitor to a page called 405.html which details why the request was blocked.

For some reason, NGinx seems to be quite determined not to use custom error pages for 405/406 etc, will come back and look at sorting that out later. For now the config in place is
    error_page 405 = /405.html; # This has no impact currently
    location /405.html {
        root /usr/share/nginx/onions/bentaskercouk;

    if ($http_x_tor2web){
        set $tor2web T;

    # Avoid redirect loops
    if ($request_uri = '/405.html'){
        set $tor2web R;

    if ($tor2web = T){
        return 301 /405.html;
Will get the 50x error page built a little later
btasker changed status from 'In Progress' to 'Resolved'
btasker added 'Done' to resolution
btasker changed status from 'Resolved' to 'Closed'