以下nginx配置是最新手机游戏网 正在使用的配置
访问速度非常优秀,对nginx进行了优化
希望对您有些帮助
user www www;
worker_processes 8;
worker_cpu_affinity 0001 0010 0100 1000 0001 0010 0100 1000;
worker_rlimit_nofile 65535;
error_log /usr/local/nginx/logs/error.log crit;
pid /usr/local/nginx/nginx.pid;
events {
use epoll;
worker_connections 65535;
}
http {
include mime.types;
default_type application/octet-stream;
server_names_hash_bucket_size 128;
client_header_buffer_size 32k;
large_client_header_buffers 4 32k;
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 64k;
fastcgi_buffers 4 64k;
fastcgi_busy_buffers_size 128k;
fastcgi_temp_file_write_size 128k;
fastcgi_intercept_errors on;
gzip on;
gzip_min_length 1k;
gzip_buffers 4 16k;
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 80;
server_name www.19195.cn 19195.cn;
if ($host != 'www.19195.cn' ) {
rewrite ^/(.*)$ http://www.19195.cn/$1 permanent;
}
index index.html index.htm index.php;
root /www/ws/doubanapp;
error_page 404 /404.html;
error_page 403 /404.html;
location ~ .*\.(php|php5)?$
{
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi.conf;
}
location / {
rewrite ^/search/(.*)/([0-9]+).html$ /index.php?s=/Home-vod-search-wd-$1-p-$2 last;
rewrite ^/play/([0-9]+)/([0-9]+)/([0-9]+).html$ /index.php?s=/Home-vod-play-id-$1-sid-$2-pid-$3 last;
rewrite ^/vod-(.*)\.html$ /index.php?s=/Home-vod-$1 last;
rewrite ^/news-(.*)$ /index.php?s=/Home-news-$1 last;
rewrite ^special-(.*)$ /index.php?s=/Home-special-$1 last;
rewrite ^/tag-(.*)$ /index.php?s=/Home-tag-$1 last;
rewrite ^/gb-(.*)$ /index.php?s=/Home-gb-$1 last;
rewrite ^/cm-(.*)$ /index.php?s=/Home-cm-$1 last;
rewrite ^/map-(.*)$ /index.php?s=/Home-map-$1 last;
rewrite ^/my-(.*)$ /index.php?s=/Home-my-$1 last;
rewrite ^/Tpl/(.*)/Home/(.*).html$ /index.php last;
rewrite ^/MvTop9/(.*)$ /detail/live.html last;
rewrite ^/list/([0-9]+)/([0-9]+).html$ /index.php?s=/Home-vod-show-id-$1-p-$2 last;
rewrite ^/channel$ /index.php?s=/Home-vod-show-id-1-p-1 last;
rewrite ^/teleplay$ /index.php?s=/Home-vod-show-id-2-p-1 last;
}
location ~(favicon.ico) {
log_not_found off;
expires 99d;
break;
}
location ~(robots.txt) {
log_not_found off;
expires 7d;
break;
}
location ~ ^/data {
deny all;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|js|css|zip|rar)$
{
access_log off;
expires 30d;
}
location ~ .*\.(js|css)?$
{
access_log off;
expires 1h;
}
log_format access '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" $http_x_forwarded_for';
access_log /ss/wws/19195_access.log access;
error_page 404 /404.html;
}
server {
listen 80;
server_name www.tiaoju.com tiaoju.com;
if ($host != 'www.tiaoju.com' ) {
rewrite ^/(.*)$ http://www.tiaoju.com/$1 permanent;
}
index index.html index.htm index.php;
root /www/wws/tiaoju;
error_page 404 /404.html;
error_page 403 /404.html;
location ~ .*\.(php|php5)?$
{
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi.conf;
}
location / {
rewrite ^/guochan$ /index.php?s=/Home-vod-show-id-15-p-1 last;
rewrite ^/tvb$ /index.php?s=/Home-vod-show-id-16-p-1 last;
rewrite ^/oumei$ /index.php?s=/Home-vod-show-id-17-p-1 last;
rewrite ^/rihan$ /index.php?s=/Home-vod-show-id-18-p-1 last;
rewrite ^/haiwai$ /index.php?s=/Home-vod-show-id-19-p-1 last;
rewrite ^/dongzuo$ /index.php?s=/Home-vod-show-id-8-p-1 last;
rewrite ^/xiju$ /index.php?s=/Home-vod-show-id-9-p-1 last;
}
location ~(favicon.ico) {
log_not_found off;
expires 99d;
break;
}
location ~(robots.txt) {
log_not_found off;
expires 7d;
break;
}
location ~ ^/data {
deny all;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|js|css|zip|rar)$
{
access_log off;
expires 30d;
}
location ~ .*\.(js|css)?$
{
access_log off;
expires 1h;
}
log_format access23 '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" $http_x_forwarded_for';
access_log /sss/www/tiaoju_access.log access;
error_page 404 /404.html;
}
server{
listen 80 default;
server_name _;
rewrite ^(.*) http://www.19195.cn permanent;
}
# 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;
# server_name localhost;
# ssl on;
# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;
# ssl_session_timeout 5m;
# ssl_protocols SSLv2 SSLv3 TLSv1;
# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on;
# location / {
# root html;
# index index.html index.htm;
# }
#}
}
相关推荐
Nginx实战:基于Lua语言的配置、开发与架构详解
Nginx实战最全教程
第1章 Nginx简介.pdf第2章 Nginx服务器的安装与配置.pdf第3章 Nginx的基本配置与优化.pdf第4章 Nginx与PHP(FastCGI)的安装、配置与优化.pdf第5章 Nginx与JSP、ASP.NET、Perl的安装与配置.pdf第6章 Nginx HTTP负载...
已经亲自试用过了,保证可用,否则退您积分
Nginx实战经验技巧大全
Nginx实战进阶
计算机后端-PHP视频教程. Nginx-01Nginx实战.doc
第八讲Nginx实战进阶.pptx
当今最火的FREE数据库软件Nginx,国人所著,中文PDF
Nginx实战配置,里面罗列了本文博客中的叙述点 http://blog.csdn.net/shuzui1985/article/details/8581755
实战nginx.pdf。主要内容包括:第1章 Nginx简介;第2章Nginx服务器安装与配置;第3章Nginx基本配置与优化;第4章Nginx与PHP;第5章Nginx与JSP、ASP.NET..第6章Nginx http负载均衡和反向代理;第7章Nginx 的rewrite...
nginx介绍,如何使用nginx实现负载均衡高可用和session,实现资源动静分离
实战Nginx:取代Apache的高性能Web服务器 实战Nginx:取代Apache的高性能Web服务器
【面试资料】-(机构内训资料)Nginx实战书籍
Nginx实战基础篇六通过源码包编译安装部署LNMP搭建Discuz论坛.pdf
Nginx实战基础篇六通过源码包编译安装部署LNMP搭建Discuz论坛[归纳].pdf
张晏 nginx 全套资料,从简单的nginx介绍到 负载均衡,反向代理 优化 rewrite 等等 优秀资源你值得拥有!
实战Nginx取代Apache的高性能Web服务器 文字版本。喜欢请购买纸质版支作者
Nginx (engine x) 是一个高性能的HTTP(解决C10k的问题)和反向代理服务器,也是一个IMAP/POP3/SMTP服务器。