nginx链接jsp的相关配置
把nginx和resin安装完后,nginx 是80端口;resin是8080端口
resin的 相应root目录放在/data/myjsp.com/处
如何用nginx做jsp的代理服务器(nginx不支持jsp)
server {
server_name www.myjsp.com;
listen 127.0.0.1:80;
gzip on;
gzip_comp_level 9;
client_max_body_size 10m;
error_log /usr/local/nginx/logs/error.log;
access_log /usr/local/nginx/logs/access.log;
index index.html;
root /data/myjsp.com/;
location ~ .+\.[gif|jpg|jpeg|png|ico|rar] {
expires 1M;
}
location ~ .*\.jsp$ {
proxy_pass http://127.0.0.1:8080;
include /usr/local/nginx/conf/proxy.conf;
}
}
proxy.conf文件
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 10m;
client_body_buffer_size 128k;
proxy_connect_timeout 30;
proxy_send_timeout 30;
proxy_read_timeout 30;
proxy_buffer_size 4k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
这样可以打开jsp页面,但无法完全正确的解释<%%>里的内容。
比如3+4=<%=3+4%>
他只显示3+4=
我是哪里配错呢?请指点一二