分类: LINUX
2012-04-19 22:27:53
#
server {
listen 80;
server_name demo.com;
index index.php index.html;
root /opt/b2c/web/com/
access_log /opt/b2c/logs/nginx/
error_log /opt/b2c/logs/nginx/
location ~* .(jpg|gif|png|js|css)$ {
if (-f $request_filename) {
expires 24h;
break;
}
}
location /status {
stub_status on;
}
location / {
try_files $uri $uri/ /index.php?q=$uri&$args;
}
location ~ \.php$ {
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# proxy_hide_header Content-Type;
proxy_buffer_size 500k;
proxy_buffers 5 500k;
proxy_pass ;
}
}