Articles of http status code 404

Nginx的error_page不提供PHP文件

我试图build立一个404文件,它处理未知的url请求使用error_page指令,该文件即时尝试将其根目录是一个.php文件,这是在path相同的目录。 我无法弄清楚的问题是,只要我创build一个404路由,并定义它的位置似乎下载文件,而不是服务它。 为了testing我不会精神错乱,我把额外的PHP文件放在404规则之外,他们运行并返回内容,但404规则文件只是下载 我的configuration的片段是 root /var/www/itn; index index.php index.html index.htm; location / { try_files $uri $uri/ /index.php$is_args$args; } location ~* \.(jpg|jpeg|gif|png|css|js|ico|xml)$ { access_log off; log_not_found off; expires 1d; } error_page 404 /404.php; location = /404.php{ root /var/www/itn; } error_page 500 502 503 504 /50x.html; location = /50x.html { root /var/www/error/html; } location ~ \.php$ { […]

Nginx经常返回404

我在Ubuntu 14.04中有一个Nginx 1.4的服务器,它运行的是PHP5-fpm。 服务器在私有云服务器中有多个域和子域。 服务器从stream量中获得一致的点击量并且很多。 一切都很好,但Nginx经常返回404,而事实上并没有在实际的情况下,尝试之后,它返回的实际输出,而不是404。下面是我的一个从nginxconfiguration的服务器块的一个例子。 server { listen 80; #listen [::]:80; root /var/www/appfolder; index index.php index.html index.htm; # Make site accessible from http://localhost/ server_name domain-name; location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. try_files $uri $uri/ =404; # Uncomment to […]

Nginx + PHP没有findindex.php 404

我用nginx 12和php7.1运行debian 9 我已经设置好了。 Nginx不会在错误日志中给我任何东西,所有的PHP脚本都100%正常工作。 Nginx索引index.html作为索引,但没有findindex.php并返回404,即使我已经在nginxconfiguration中设置它。 这是我的nginxconfiguration: server { listen 80 default_server; listen [::]:80 default_server; # SSL configuration # # listen 443 ssl default_server; # listen [::]:443 ssl default_server; # # Note: You should disable gzip for SSL traffic. # See: https://bugs.debian.org/773332 # # Read up on ssl_ciphers to ensure a secure configuration. # See: […]

如何用Nginx中的其他URLreplace/ wp-admin?

我在我的网站上有一个WordPress,我想隐藏并保护对仪表板的访问。 它与Nginx一起工作在VDS内部。 我想访问者看到404错误页面,如果他访问/wp-login.php或任何/ wp-admin / *页面 但为了让我的团队访问仪表板,我希望他们访问这些页面的不同URL,如/log-in.php(要inputlogin凭据),并使仪表板在/ root / * URL可用。 以前,我使用插件来实现这一点,但他们只能使用Apache。

强制apache在自定义错误页面后在error.log中写入“找不到文件”

在apache2中启用本地化错误页面后,我在apache error.log文件中丢失了“文件不存在”。 消息错误“404”仍然在access.log中,但是我需要error.log中的“文件不存在”消息,以便Fail2Ban apache-botsearch正常工作。 我已经阅读增加日志级别在Apache的“信息”可以解决这个问题,但我不想被不必要的信息充斥。 任何人都可以帮我吗? 问候

在本地主机上调用IIS 6 404错误

我有点绝望 我有一个Windows 2003服务器,当我尝试调用http:// localhost我得到一个404错误 我有localhostconfiguration为c:\ inetpub \ wwwroot \和无论我创build的文件,它总是显示一个404 这是我在日志文件中看到的 2010-07-22 14:54:06 W3SVC1 127.0.0.1 GET / – 80 – 127.0.0.1 Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.2;+SV1;+.NET+CLR+1.1.4322;+.NET+CLR+2.0.50727;+.NET+CLR+3.0.4506.2152;+.NET+CLR+3.5.30729) 404 0 3 我尝试重新启动IIS没有运气,eventvwr显示没有任何错误。 请任何灯光将被解雇

强制Apache在每个请求上返回404

我想我的Apache返回404的所有HTTP GET请求。 包括HTTP GET /。 试图玩mod_rewrite为此(404.gif显然不退出) RewriteEngine on RewriteRule .* 404.gif [L] 但它似乎没有performance得很好,这是由于某种原因返回400坏请求。 有人可以请提供一个Apache 2的configuration示例,将导致它始终返回美好的404? PS忘了提及,我将这个configuration用于HTTP和HTTPS。 谢谢,Maxim。

使用apache和FileNotFound错误的子域

我正在尝试使用Apache VirtualHosts来设置子域名。 我到目前为止是: NameVirtualHost *:80 <VirtualHost *:80> ServerName www.domain.aa DocumentRoot /var/www/html </VirtualHost> <VirtualHost *:80> ServerName wiki.domain.aa DocumentRoot /var/www/html/wiki </VirtualHost> 这个configuration工作得很好,在浏览器中键入wiki.domain.aa时出现子域。 然而,只有第一页出现。 每当浏览器尝试加载由子域支持的url(例如wiki.domain.aa / style.css),我得到一个文件未find错误… 有没有人知道这是关于什么的? 非常感谢你提前。 马蒂亚斯

configurationApache2只响应虚拟主机

有一台服务器在查看日志的同时,通过自动化脚本寻找漏洞,通过直接IP地址,每天看起来会多次被点击很多次。 参赛作品如: [Sat Jul 31 17:45:01 2010] [error] [client xxx.xxx.xxx.xxx] script '/var/www/phpMyAdmin' not found or unable to stat 我在这个系统上运行了许多虚拟服务器,但是没有直接的IP。 所有这些尝试导致404,这是好的,但我宁愿没有服务器响应。 任何方式来configuration,说/网站,可用/默认为简单地删除它收到的每个请求? 谢谢

Awstats显示奇怪的404引用

当我看到Awstats 404错误时,我会看到有时会出现奇怪的引用。 例如在www.mydomain.com上,我可能会看到在Awstats中报告的404错误: URL (not found) Referrers some-file.jpg http://www.mydomain.com/some-page.html some-file.jpg是一个不存在的文件,所以如果有人试图find它,从服务器获得404就不奇怪了。 奇怪的部分是,引用页面不存在,我的意思是http://www.domain.com/some-page.html不存在,所以怎么可能是推荐人? 是否有一些客户欺骗推荐人? 谢谢!