我们在使用Nginx resin的时候有不少的问题困扰着我们,其实这些都是可以轻松解决的。下面我们就来研究下如何使用Nginx resin的proxy功能,将请求转发给resin。修改Nginx的配置文件Nginx.conf
Nginx resin程序代码
server {
listen 80;
server_name www.suneca.com;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
location / {
access_log on;
proxy_pass http://127.0.0.1:8080;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 10m;
client_body_buffer_size 128k;
}
}
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
- 14.
- 15.
- 16.
- 17.
重起Nginx resin
如果可以访问得到resin经典的欢迎页面,那说明成功了;重起一下服务器,检查一下是否Nginx跟resin可以自动启动。
【编辑推荐】