Nginx常用配置--代理PHP服务
server {
listen 443 ssl;
server_name www.weijishu.cn;
ssl_certificate /etc/nginx/conf.d/ssl/admin.alxxj.cn.pem;
ssl_certificate_key /etc/nginx/conf.d/ssl/admin.alxxj.cn.key;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
index index.html index.php;
root /var/www/html/alice/admin/web;
rewrite (\/\.svn|.git\/) /404/;
if ($http_user_agent ~* yahoo|bingbot) {
return 403;
}
if ($query_string ~* ".*(insert|select|delete|update|count|master|truncate|declare|'|%27|%22|%3C|%3E|;|%20and%20|%20or%20).*"){
return 404;
}
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
location ~ .*\.(php|php5)?$
{
fastcgi_pass 127.0.0.1:9000;
fastcgi_param ENV 'prod';
fastcgi_index index.php;
include fastcgi.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 1h;
}
#日志
access_log off;
}
上一篇: ssm/php/no
下一篇: JavaScript