浏览 3.1k
例如
baidu.com/inner
baidu.com
根据 url 中 是否包含 inner 访问不同ip
Nginx涉及的业务场景很多,面试官可以问的点太多了,要看他的经验偏向哪块,如果有条件,可以先打听下他做过哪些业务。
我简单总结下,Nginx大概可以问这几个方向:
1、基本配置,比如server_name、location的匹配,rewrite的重定向规则,if有哪些陷井等。
2、反向代理,比如一致性hash算法该怎么配,keepalive请求有什么问题,如果上游挂了,怎么换一台新上游,但不给用户返回错误?
3、缓存类,比如过期缓存怎么配,合并回源怎么弄,cache manager、cache loader工作模式等
4、针对WAF防火墙等应用场景,可以展开了问HTTP协议的知识,比如POST请求的处理,比如tailer头部的处理等。
5、进程维护,包括热加载、热升级、切割日志文件、日志压缩等。
6、静态资源,比如root/alias的区别,比如aio/sendfile的选择等。
7、如果是做C模块开发的团队,会问很多源码、实现层面的问题。
8、如果偏向Openresty的团队,会问很多Lua模块的用法,特别是Lua原生函数与ngx库的使用。
9、TLS/SSL,比如对下游、上游怎么开启TLS,对HTTP、TCP怎么开启,怎么传递域名、IP地址等
并不全面,仅供参考哈
第1种。参考官方文档:
“When buffering is enabled, nginx receives a response from the proxied server as soon as possible, saving it into the buffers set by the proxy_buffer_size and proxy_buffers directives. If the whole response does not fit into memory, a part of it can be saved to a temporary file on the disk. Writing to temporary files is controlled by the proxy_max_temp_file_size and proxy_temp_file_write_size directives.
When buffering is disabled, the response is passed to a client synchronously, immediately as it is received. nginx will not try to read the whole response from the proxied server. The maximum size of the data that nginx can receive from the server at a time is set by the proxy_buffer_size directive.”
微信公众号
加入微信群