nginxarchitecture
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
nginxarchitecture [2024/10/27 02:01] – [Basic Nginx Configuration] admin | nginxarchitecture [2024/10/27 02:55] (current) – [Basic Nginx Configuration] admin | ||
---|---|---|---|
Line 27: | Line 27: | ||
* The performance and scalability of Nginx is not completely dependent on hardware resources, whereas the performance and scalability of the Apache is dependent on underlying hardware resources like memory and CPU. | * The performance and scalability of Nginx is not completely dependent on hardware resources, whereas the performance and scalability of the Apache is dependent on underlying hardware resources like memory and CPU. | ||
===== Basic Nginx Configuration ===== | ===== Basic Nginx Configuration ===== | ||
- | refer: https:// | + | Some basic directives: |
- | <code ini> | + | * Location (refer: https:// |
user nobody; # a directive in the ' | user nobody; # a directive in the ' | ||
Line 59: | Line 59: | ||
} | } | ||
} | } | ||
+ | </ | ||
+ | * request_filename (refer: https:// | ||
+ | if (!-e $request_filename) { rewrite ^ / | ||
+ | </ | ||
+ | * try_files (refer https:// | ||
+ | location / { | ||
+ | try_files $uri $uri/ $uri.html =404; | ||
+ | } | ||
+ | </ | ||
+ | location / { | ||
+ | try_files $uri $uri/ / | ||
+ | } | ||
+ | </ | ||
+ | location / => matches all locations** | ||
+ | try_files $uri =>try $uri first, for example http:// | ||
+ | $uri/=> which means if you didn't find the first condition $uri try the URI as a directory | ||
</ | </ | ||
===== Optimize nginx configuration for performance and benchmark ===== | ===== Optimize nginx configuration for performance and benchmark ===== |
nginxarchitecture.1729994505.txt.gz · Last modified: 2024/10/27 02:01 by admin