nginx资料汇总

 

nginx docker 中的一些目录和 windows下是不同的, 

静态内容目录: /usr/share/nginx/html

配置文件目录: /etc/nginx

日志输出目录: /var/log/nginx/log

更多nginx docker 的信息, 见 https://docs.nginx.com/nginx/admin-guide/installing-nginx/installing-nginx-docker/

 

下面是 nginx.conf 设置反向代理的示例: 

location / {
proxy_pass http://app:8080;
proxy_set_header Host $host:$server_port;
proxy_set_header X-Forwarded-Host $server_name;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

 

找到 4 篇不错的文章, 

文章1: 有简明的nginx工具命令介绍, 以及 api 反向代理的简单设置. 

文章2:  介绍几个前端 ajax 跨域请求的解决方法, 当然nginx反向代理是最简单有效的方法. 

文章3: 介绍 nginx 为什么如此高效, 主要是因为采用了 epoll 事件驱动的多路复用技术. 

文章4: 是一个系列的教程, 反向代理/负载均衡/支持https等等. 

 

Nginx 反向代理 API 与 Nginx 教程

https://blog.csdn.net/qq_39759115/article/details/83615844 

 

nginx反向代理-解决前端跨域问题

https://www.cnblogs.com/renjing/p/6394725.html

 

【大型网站技术实践】初级篇:借助Nginx搭建反向代理服务器

https://www.cnblogs.com/edisonchou/p/4126742.html

 

nginx 入门到进阶的教程

https://www.kancloud.cn/hfpp2012/nginx-tutorial/467009

https://github.com/yinsigan/nginx-tutorial

posted @ 2019-04-02 21:06  harrychinese  阅读(387)  评论(0编辑  收藏  举报