我们都知道nginx是可以做跨域代理的:
location ^~ /visited-path/ { proxy_pass http://another-domain/; }
我们都知道nginx是可以做跨域代理的:
location ^~ /visited-path/ { proxy_pass http://another-domain/; }
使用nginx搭建的站点,如果不想让所有人都能正常访问,那么可以设置访问认证,只有用户输入正确的用户名和密码才能正常访问。效果如下:
cat 日志.log | awk -F ' ' '{print $1}' | sort | uniq -c | sort -nr
查看最近访问平常的ip,一般攻击的都是各种充分访问或者各种尝试攻击,在短时间log很容易看的出来,这里直接能列得出每个IP的访问次数,
如果IP过多,加个|head查看前10
感觉那个ip疑是就
cat 日志.log | grep '这个ip'
最好导出来看,一般是攻击看大访问的地址 等等形式就看得出来了
rewrite功能就是,使用nginx提供的全局变量或自己设置的变量,结合正则表达式和标志位实现url重写以及重定向。rewrite只能放在server{},location{},if{}中,并且只能对域名后边的除去传递的参数外的字符串起作用,例如 /a/we/index.php?id=1&u=str
只对/a/we/index.php重写。语法rewrite regex replacement [flag];
很多框架默认路由都是 PATH_INFO 模式,比如默认在 Apache 并且没有 rewrite 时,CodeIgniter 一般可以这样访问 /index.php/controller/action ,那么 nginx 和 php-fpm 如何设置支持 PATH_INFO 模式呢?
php.ini 中一个与 PATH_INFO 有关的设置是 cgi.fix_path 默认为 1,我们将其设置为 0。
在 Windows 7上安装了个 ApacheFriends XAMPP Version 1.8.2,浏览网站时出现如下错误:
Access forbidden!
You don't have permission to access the requested directory. There is either no index document or the directory is read-protected.
If you think this is a server error, please contact the webmaster.
Error 403
127.0.0.11
Apache/2.4.10 (Win32) OpenSSL/1.0.1h PHP/5.4.31
刚装完 PHP、Nginx,准备跑下 phpMyAdmin 程序,结果报以下错误:
An error occurred.
Sorry, the page you are looking for is currently unavailable.
Please try again later.If you are the system administrator of this resource then you should check theerror log for details.
Faithfully yours, nginx.