nginx配置
来源:互联网 发布:js中定义数组 编辑:程序博客网 时间:2024/05/01 01:03
nginx.conf是nginx的核心配置文件。存放在\nginx\conf路径下。现将其摘录、简单说明如下。
server{
listen 80;
charset utf-8;
#access_log logs/access.www.test.com.log; #日志输出路径配置
rewrite ^/dept-(\d+)/$ /gwy/gwyList.shtm?deptId=$1 last; #静态地址转发 可做SEO优化
rewrite ^/job-(\d+)/$ /gwy/gwyDetail.shtm?jobId=$1 last;
rewrite ^/kso-([0-9a-zA-Z]+)/$ /gwy/gwyKso.shtm last;
rewrite ^/so-([0-9a-zA-Z]+)-([0-9a-zA-Z]+)-(\d+)-(\d+)-(\d+)/$ /gwy/gwyData.shtm last;
location / {
proxy_pass http://test; # 与upstream保持一致
proxy_buffer_size 64k;
proxy_buffers 4 64k;
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;
}
error_page 404 /404.htm;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
server_name www.test.com; #域名
#error_log logs/error.www.test.com.log; #错误日志输出路径配置 启动报错时可查看此文件
}
upstream test{ #与proxy_pass 保持一致
ip_hash;
server 127.0.0.1:5678;
}
另附:Linux下重启nginx命令:进入nginx目录 执行:sbin/nginx -s reload
- Varnish+Nginx 配置----Nginx
- Nginx-配置-nginx.conf
- 【Nginx】Nginx配置优化
- 105 nginx nginx 配置
- nginx nginx.conf 配置
- nginx 配置
- nginx 配置
- Nginx配置
- nginx配置
- NGINX配置
- nginx配置
- Nginx配置
- nginx配置
- nginx配置
- nginx 配置
- nginx 配置
- nginx配置
- Nginx配置
- 值得思考的一道题 2013腾讯编程马拉松初赛 HDU 4503
- addContentView的使用
- echache
- Spring AOP 初探
- awk的读取处理结构数据的案例
- nginx配置
- VS.NET2010水晶报表安装部署[VS2010]
- Iphone开发之音频101 (第一部分): 文件和数据类型
- rt3070 移植到at91 linux记录
- 使用 udev 高效、动态地管理 Linux 设备文件
- 双飞翼布局(圣杯布局)介绍-始于淘宝UED
- Android之googleMap
- JS 3D玫瑰
- 利用moderncv自定制简历样式