nginx location规则替换

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 server { listen 80; server_name www.6dgame.com 6dgame.com; location /2013/ { proxy_pass http://127.0.0.1:8081/; } location / { proxy_pass http://127.0.0.1:8080/; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } } 对于此种设置方法, 访问:http://54.

SpringMVC Controller层中 request接收参数乱码

直接使用 1 String email = request.getParameter("email"); 接收到email是乱码,需要转换 1 email = new String(request.getParameter("email").getBytes("ISO-8859-1"),"UTF-8"); 这样麻烦还需要处理异常。 还可以这么解决: web.xml 1 2 3 4 5 6 7 8 9 10 11 12 <filter> <filter-name>CharacterEncodingFilter</filter-name> <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class> <init-param> <param-name>encoding</param-name> <param-value>utf-8</param-value> </init-param>

亚马逊EC2上搭建Node.js

1、安装Node,js编译工具 1 sudo yum install gcc-c++ openssl-devel make curl git 2、下载Node.js源码、编译、安装 1 2 3 4 5 6 7 8 9 wget http://nodejs.org/dist/v0.10.25/node-v0.10.25.tar.gz tar -xvf node-v0.10.25.tar.gz cd node-v0.10.25 ./configure make 在此make会需要

AWS EC2上配置Tomcat

一、官网下载 Tomcat ,然后上传解压到EC2主机上,我这解压到: 1 /usr/local/apache-tomcat-7.0.47 二、添加环境变量。此次EC2主机是自带JRE的,位置是: 1 /usr/lib/jvm 我只需在/etc/p