Add new page for nginx

This commit is contained in:
James Skemp 2022-11-05 12:08:49 -05:00
parent b8a8906367
commit 067704f3c4
3 changed files with 47 additions and 0 deletions

View File

@ -6,6 +6,7 @@
- [PowerShell Profile](./powershell/profile.md)
- [Windows Commands](./windows.md)
- [Linux Commands](./linux.md)
- [nginx](./nginx.md)
- [Raspberry Pi Commands](./pi.md)
- [macOS Commands](./macos.md)
- [T-SQL](./tsql.md)

View File

@ -97,6 +97,9 @@ mv file1.txt file2.txt new-dir dir1
# Rename a file.
mv file.txt new-name.txt
# Rename a directory.
mv dir-name new-dir-name
# Copy a file
cp path/to/file.txt .
cp file.txt copy-file.txt

43
src/nginx.md Normal file
View File

@ -0,0 +1,43 @@
# nginx
- [Documentation](https://nginx.org/en/docs/)
- [Getting Started Wiki](https://www.nginx.com/resources/wiki/start/)
## Configuration
```bash
# Test/verify configuration.
sudo nginx -t
# View base configuration.
sudo cat /etc/nginx/nginx.conf
# View default site configuration.
sudo cat /etc/nginx/sites-enabled/default
# List enabled sites.
ls -l /etc/nginx/sites-enabled/
# List available sites.
ls /etc/nginx/sites-available/
# Enable site via a symbolic link.
sudo ln -s /etc/nginx/sites-available/SITE_CONFIG_FILE_NAME /etc/nginx/sites-enabled/
# Remove symbolic link/enabled site.
sudo rm SITE_CONFIG_FILE_NAME
sudo unlink SITE_CONFIG_FILE_NAME
# Remove with confirmation.
sudo rm -i SITE_CONFIG_FILE_NAME
```
## Logging
```bash
# View access logs.
sudo cat /var/log/nginx/access.log
```
## Management
```bash
# Restart nginx.
sudo systemctl restart nginx
```