server {
listen 80;
server_name
#路径根据 Resin定义路径配置,这里根据默认
root /usr/local/resin/webapps/ROOT;
index index.html index.php index.jsp index.html;
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# include fastcgi.conf;
# }
location ~ .(jsp|jspx|do)?$ {
proxy_set_header Host $host;
proxy_pass :8080;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
client_max_body_size 10m;
client_body_buffer_size 128k;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffer_size 4k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
}
location ~ .*\.(htm|html|gif|jpg|jpeg|png|bmp|swf|ioc|rar|zip|txt|flv|mid|doc|ppt|pdf|xls|mp3|wma)$ {
expires 30d;
}
location ~ .*\.(js|css)?$ {
expires 12h;
}
}
下面关于Nginx的文章您也可能喜欢,不妨参考下:
CentOS 7.2下编译安装PHP7.0.10+MySQL5.7.14+Nginx1.10.1
搭建基于Linux6.3+Nginx1.2+PHP5+MySQL5.5的Web服务器全过程
CentOS 6.4安装配置Nginx+Pcre+php-fpm