Difference between revisions of "Nginx"
From Wasya Wiki
| (10 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
| − | * [[ Nginx Passenger ]] | + | |
| + | * See also [[ webdav ]] | ||
| + | * See also [[ Nginx Passenger ]] | ||
| + | |||
| + | = Install = | ||
| + | |||
| + | From source: https://nginx.org/en/download.html | ||
| + | |||
| + | apt-get install libpcre3 libpcre3-dev | ||
| + | ./configure --with-http_dav_module | ||
| + | make | ||
| + | make install | ||
| + | |||
| + | |||
| + | |||
| + | = Use = | ||
== basic auth == | == basic auth == | ||
| Line 5: | Line 20: | ||
sudo htpasswd -c /etc/apache2/.htpasswd user1 | sudo htpasswd -c /etc/apache2/.htpasswd user1 | ||
| − | sudo htpasswd /etc/apache2/.htpasswd user2 | + | sudo htpasswd /etc/apache2/.htpasswd user2 |
location /api { | location /api { | ||
| Line 11: | Line 26: | ||
auth_basic_user_file /etc/apache2/.htpasswd; | auth_basic_user_file /etc/apache2/.htpasswd; | ||
} | } | ||
| + | |||
| + | == performance == | ||
| + | From: https://medium.com/@anirudhdey/maximizing-concurrency-in-nginx-tips-and-trick-df23c10cda71 | ||
| + | |||
| + | == restart == | ||
| + | |||
| + | sudo pkill -f nginx & wait $! | ||
| + | sudo systemctl start nginx | ||
Revision as of 15:52, 10 December 2024
- See also webdav
- See also Nginx Passenger
Install
From source: https://nginx.org/en/download.html
apt-get install libpcre3 libpcre3-dev ./configure --with-http_dav_module make make install
Use
basic auth
From: https://docs.nginx.com/nginx/admin-guide/security-controls/configuring-http-basic-authentication/
sudo htpasswd -c /etc/apache2/.htpasswd user1 sudo htpasswd /etc/apache2/.htpasswd user2
location /api {
auth_basic "Administrator’s Area";
auth_basic_user_file /etc/apache2/.htpasswd;
}
performance
From: https://medium.com/@anirudhdey/maximizing-concurrency-in-nginx-tips-and-trick-df23c10cda71
restart
sudo pkill -f nginx & wait $! sudo systemctl start nginx