public
Created

Nginx intercept errors.

  • Download Gist
gistfile1.nginxconf
Nginx
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
user nginx nginx;
worker_processes 3;
worker_rlimit_nofile 200000;
 
error_log /var/log/nginx/error.log notice;
 
events {
worker_connections 16384;
multi_accept on;
use epoll;
}
 
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
 
 
proxy_http_version 1.1;
keepalive_timeout 75 20;
keepalive_requests 100000;
 
upstream origin {
server 127.0.0.1:8080;
keepalive 512;
}
 
server {
listen *:80;
 
location / {
error_page 501 /static-76dd4ef06ba00b107cd804ea94f4bee7/error.html;
proxy_set_header Host $host;
proxy_set_header Connection "";
proxy_intercept_errors on;
proxy_pass http://origin;
}
location ^~ /static-76dd4ef06ba00b107cd804ea94f4bee7 {
root /var/www/localhost/htdocs;
}
}
 
server {
listen *:8080;
location / {
return 501;
}
}
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.