NGINX rule for notfoundfallback
@@ -31,11 +31,22 @@ server {
proxy_set_header X-Forwarded-Host $host;
proxy_intercept_errors on;
- error_page 404 = @fallback;
+ error_page 404 = @notfoundfallback;
add_header X-Served Nginx-Proxito-Sendfile always;
}
+ # Serve 404 pages here
+ location @notfoundfallback {
+ proxy_pass http://proxito:8000/_proxito_404_$request_uri;
+
+ proxy_set_header Host $http_host;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header X-Forwarded-Host $host;
+ add_header X-Served Proxito-404-Fallback always;
+ }
+
# Main RTD site for non-doc serving needs
location @fallback {
# Include $request_uri instead of the matched URI for the block.
