4 ms·
NginX has come a long way and so has the documentation: http://nginx.org/en/docs/ http://nginx.org/en/docs/ I highly recommend this document to start, which de
by merlincorey 11y ago
NginX has come a long way and so has the documentation: http://nginx.org/en/docs/ http://nginx.org/en/docs/
I highly recommend this document to start, which describes how NginX processes a request: http://nginx.org/en/docs/http/request_processing.html http://nginx.org/en/docs/http/request_processing.html
For getting the mental model right, you have to understand that NginX configuration is declarative, like SQL or PROLOG. That means as opposed to an imperative or procedural language you might be more familiar with, in NginX you describe "what" you want to have handled, not "how" and NginX worries about the "how" under the hood, for the most part.
Of course like any abstraction it sometimes breaks and leaks, but this is practical software we're talking about. One specific big headache for people is when using "if" in NginX, which is a decidedly imperative construct! As such you do have to tread lightly with it; observe If Is Evil: https://www.nginx.com/resources/wiki/start/topics/depth/ifisevil/ https://www.nginx.com/resources/wiki/start/topics/depth/ifis...