配置文件具体如下,此配置文件已在某行业网站生产环境中实验成功。
user www webuser;
worker_processes 1;
error_log /web/logs/nginx_error.log crit;
pid /usr/local/nginx/logs/nginx.pid;
#Specifies the value for maximum file descriptors that can be opened by this process.
worker_rlimit_nofile 65535;
events
{
use epoll;
worker_connections 65535;
}
http
{
include mime.types;
default_type application/octet-stream;
#charse gb2312;
server_names_hash_bucket_size 128;
client_header_buffer_size 32k;
large_client_header_buffers 1 128k;
client_max_body_size 8m;
sendfile on;
tcp_nopush on;
keepalive_timeout 60;
tcp_nodelay on;
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
fastcgi_buffer_size 128k;
fastcgi_buffers 8 128k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
fastcgi_intercept_errors on;
gzip on;
gzip_min_length 1k;
gzip_buffers 1 64k;
gzip_http_version 1.0;
gzip_comp_level 2;
gzip_types text/plain application/x-javascript text/css application/xml;
gzip_vary on;
server
{
listen 203.130.37.35:80;
server_name www.luxee.com luxee.com;
index index.php index.html index.htm;
root /web/luxee/domains/new.luxee.com/public_html/;
location / {
if ( $args ~ "mosConfig_[a-zA-Z_]{1,21}(=|\%3d)" ) {
set $args "";
rewrite ^.*$ http://$host/index.php last;
return 403;}
if ( $args ~ "base64_encode.*\(.*\)") {
set $args "";
rewrite ^.*$ http://$host/index.php last;
return 403;}
if ( $args ~ "(\<|%3C).*script.*(\>|%3E)") {
set $args "";
rewrite ^.*$ http://$host/index.php last;
return 403;}
if ( $args ~ "GLOBALS(=|\[|\%[0-9A-Z]{0,2})") {
set $args "";
rewrite ^.*$ http://$host/index.php last;
return 403;}
if ( $args ~ "_REQUEST(=|\[|\%[0-9A-Z]{0,2})") {
set $args "";
rewrite ^.*$ http://$host/index.php last;
return 403;}
if (!-e $request_filename) {
rewrite (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$ /index.php last;
break;
}
}
location ~ .*\.(php|php5)?$
{
fastcgi_pass unix:/tmp/php-cgi.sock;
#fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fcgi.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
access_log /web/logs/luxee.com-access.log;
}
}
本文来自:韦少乾博客(mven.cn)
详细出处:http://mven.cn/post/53.html
分享到:
相关推荐
Nginx常用Rewrite伪静态法则 信赖此刻大部门用Linux VPS的伴侣都在利用这个敏捷传布的Nginx,本日就清算一下最常见的PHP法式的Rewrite(伪静态法则)。 Wordpress: location / { index index.html index.php; if ...
nginx支持.htaccess伪静态rewrite的方法.docx
NGINX1.8泛解析伪静态完整文件,把后缀txt改成conf,其实我想大家看的就是泛域名部分了,因为实在没积分下载资源了,所以定了5分,请见谅。
mayicms蚂蚁分类信息5.9伪静态规则
让thinkphp3.1.3支持php7及nginx支持伪静态
蚂蚁伪静态nginx
直接把文件复制到 nginx文件夹下面 ngnix.conf里面改下你xxx.com.conf的名称和xxx.com.conf的名称
nginx设置伪静态。 用于隐藏.php后缀,在url后补斜杠/
nginx配置location总结及rewrite规则写法
宝塔linux Nginx环境WeCenter伪静态规则代码.docx
* last 相当于Apache里的[L]标记,表示完成rewrite * break 终止匹配, 不再匹配后面的规则 * redirect 返回302临时重定向 地址栏会显示跳转后的地址 * permanent 返回301永久重定向 地址栏会显示跳转后的地
本篇文档详细记录了Nginx和Apache伪静态设置的规则,作为线上维护的参考手册,在此分享,希望能帮助到有用到的朋友。
本文给大家汇总介绍了nginx中使用rewrite伪静态正则表达式的资源,非常的全面详细,有需要的小伙伴可以参考下
nginx发布前端静态文件配置
nginx下伪静态配置参数详细说明,使用nginx的朋友,nginx rewrite 伪静态配置参数和使用例子 附正则使用说明
nginx 伪静态 重定向
nginx window下的静态文件服务器 location /file/ { alias D:/upload/test/; #换成你的本地磁盘位置 index autoindex on; }
主要介绍了Yii2配置Nginx伪静态的方法,结合实例形式分析了Yii2框架针对Nginx伪静态的相关配置技巧,需要的朋友可以参考下
nginx里使用伪静态是直接在nginx.conf 中写规则的,并不需要像apache要开启写模块(mod_rewrite)才能进行伪静态。 nginx只需要打开nginx.conf配置文件,在server里面写需要的规则即可。 代码如下:server { listen ...