暂时未找到weblogic本身开启TRACE,以便用过滤器拦截不需要的HTTP方法。
所以使用nginx反向代理实现。
Nginx关键配置:
server { #部分省略 location /webroot{ #部分省略 #开启代理错误拦截 proxy_intercept_errors on; #设置只接受HTTP的GET和POST方法。 limit_except GET POST { deny all; } } #开启错误拦截 fastcgi_intercept_errors on; #自定义错误页面 error_page 500 502 503 504 501 404 405 400 403 /error.html; location = /error.html { root html; allow all; } }
放置$ngnixHome/html/error.html:
<!DOCTYPE html> <html> <head> <title>Error</title> <style> body { width: 35em; margin: 0 auto; font-family: Tahoma, Verdana, Arial, sans-serif; } </style> </head> <body> <h1>error!</h1> </body> </html>
Nginx配置文件详情:
#user nobody; worker_processes 1; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' # '$status $body_bytes_sent "$http_referer" ' # '"$http_user_agent" "$http_x_forwarded_for"'; #access_log logs/access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; gzip on; upstream mysvr { server 127.0.0.1:7002; #server 20.59.65.7:8080; #server 20.59.65.9:8080; #server 20.59.65.10:8080; ip_hash; } server { listen 1888; server_name 127.0.0.1; charset utf-8; client_max_body_size 100M; #charset koi8-r; #access_log logs/host.access.log main; location /webroot{ proxy_set_header Host $host:$server_port; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://mysvr; proxy_connect_timeout 1; proxy_send_timeout 120; proxy_read_timeout 120; limit_except GET POST { deny all; } } fastcgi_intercept_errors on; error_page 500 502 503 504 501 404 405 400 403 /error.html; location = /error.html { root html; allow all; } # redirect server error pages to the static page /50x.html # #location = /50x.html { # root html; #} # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ \.php$ { # proxy_pass http://127.0.0.1; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # #location ~ \.php$ { # root html; # fastcgi_pass 127.0.0.1:9000; # fastcgi_index index.php; # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; # include fastcgi_params; #} # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /\.ht { # deny all; #} } # another virtual host using mix of IP-, name-, and port-based configuration # #server { # listen 8000; # listen somename:8080; # server_name somename alias another.alias; # location / { # root html; # index index.html index.htm; # } #} # HTTPS server # #server { # listen 443 ssl; # server_name localhost; # ssl_certificate cert.pem; # ssl_certificate_key cert.key; # ssl_session_cache shared:SSL:1m; # ssl_session_timeout 5m; # ssl_ciphers HIGH:!aNULL:!MD5; # ssl_prefer_server_ciphers on; # location / { # root html; # index index.html index.htm; # } #} }
测试使用的Nginx版本是nginx-1.14.0 Windows版。
Nginx下载地址:http://nginx.org/en/download.html
各个发行版Linux离线安装包位于:http://nginx.org/packages/
常用Nginx命令:
nginx -s start
nginx -s stop
nginx -s reload
参考:https://stackoverflow.com/questions/8505678/nginx-error-pages-not-working
https://blog.csdn.net/xuyaqun/article/details/5988003
相关推荐
显示自定义错误页面,用户自定义
java实现自定义Weblogic监控java实现自定义Weblogic监控java实现自定义Weblogic监控
weblogic页面无法显示; 发布后登陆报500错误,Error 500--Internal Server Error From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1
WebLogic WLS组件漏洞,文档描述如何通过禁用组件的方式来修补漏洞
很详尽的weblogic错误,运行weblogic会遇到一些错误,这个文档将详细介绍这些错误及解决的方法。
自用,使用WEBLOGIC将普通http协议修改为HTTPS加密协议,为了过评审没办法,写出自用手册
weblogic不兼容客户端weblogic不兼容客户端weblogic不兼容客户端
WebLogic SSL 配置手册 WebLogic SSL 配置手册 WebLogic SSL 配置手册
Linux服务器下jdk、weblogic 、oracle的详细安装步骤和方法Linux服务器下jdk、weblogic 、oracle的详细安装步骤和方法Linux服务器下jdk、weblogic 、oracle的详细安装步骤和方法Linux服务器下jdk、weblogic 、oracle...
Weblogic license更新方法
weblogic 破解文件 破解说明 weblogic 9.2破解版 破解者:daxia2002[DFCG] web:http://www.chinadfcg.com e-mail:daxia2002@126.com win下的使用方法 1.将license.bea和weblog_crack.jar拷贝到bea安装目录下,...
WebLogic系统安全加固规范.doc
解决weblogic down 掉 被locked的情况
部署应用时,考虑到WebLogic的负载负担和访问安全性,一般在WebLogic的前端架构一个反向代理服务器,将他们整合起来使用。而大多数采用的是开源的WEB服务器(Apache)。架构方式是将Apache置于前端作为WebLogic的...
weblogic weblogic weblogic weblogic
weblogic 报 to many open file错误.docx weblogic.xml_部署描述符元素.docx Weblogic+10.3+集群配置手册.doc weblogic-debug模式启动.docx weblogic-debug模式启动.docx weblogic集群介绍.docx weblogic内存监控...
Weblogic 套件和Weblogic 标准版 Weblogic 企业版 功能对比
•1、WebLogic服务的监控 •2、WebLogic性能优化 •3、UNIX操作命令介绍 WebLogic服务的监控 •WebLogic的控制台console对内存的监控 •Console-->server-->myserver-->右边窗口Mornitoring-->Performance WebLogic...
weblogic监控 weblogic调优 weblogic版本区别 weblogic启动关闭脚本
weblogic安全管理,主要是关于安全的,对维护应该会有帮助。