nginx
$fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
修改nginx配置文件nginx.conf
vi /opt/svr/nginx/conf/nginx.conf
以公司官网121.52.220.166为例
user nobody nobody;
worker_processes 8;
#Specifies the value for maximum file descriptors that can be opened by this process.
worker_rlimit_nofile 51200;
events
{
use epoll;
worker_connections 51200;
}
http
{
include mime.types;
default_type application/octet-stream;
charset utf-8;
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;
tcp_nodelay on;
keepalive_timeout 60;
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;
gzip on;
gzip_min_length 1k;
gzip_buffers 4 8k;
gzip_http_version 1.1;
gzip_comp_level 3;
gzip_types text/plain text/javascript application/x-javascript text/css application/xml;
gzip_vary on;
proxy_temp_path /var/nginx/proxy_temp;
proxy_cache_path /var/nginx/proxy_cache levels=1:2 keys_zone=cache_one:200m inactive=1d max_size=10g;
#limit_zone crawler $binary_remote_addr 10m;
#
# gamead
#
server
{
listen 80;
server_name ad.ihuanju.com resource.ihuanju.com;
root /opt/gamead/home/public;
index index.html index.htm index.php;
access_log /opt/logs/ad.ihuanju.com/access.log;
location / {
proxy_cache cache_one;
proxy_cache_valid 200 304 12h;
proxy_cache_key $host$uri$is_args$args;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
}
location /status {
stub_status on;
access_log off;
allow 192.168.1.0/24;
allow 218.241.188.34;
deny all;
}
location ~ .*\.inc.php$ {
deny all;
}
location ~ .*\.php {
fastcgi_pass unix:/var/run/php-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|ico)$ {
expires 30d;
access_log off;
}
}
#
# gameweb
#
server
{
listen 80;
server_name ihuanju.com ;
root /opt/gameweb/home/html;
index index.html index.htm index.php;
access_log /opt/logs/www.1mpi.com;
rewrite ^/cs/(.*)$ www.1mpi.com$1 last;
location / {
proxy_cache cache_one;
proxy_cache_valid 200 304 12h;
proxy_cache_key $host$uri$is_args$args;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
}
location /status {
stub_status on;
access_log off;
allow 192.168.1.0/24;
allow 218.241.188.34;
deny all;
}


