From bf2241fb7213e2ed7da480b50bcb01e20234fef5 Mon Sep 17 00:00:00 2001 From: mycognosist Date: Wed, 8 Jul 2020 11:02:10 +0100 Subject: [PATCH] Add nginx configuration section --- .gitignore | 2 +- notes | 7 +++++++ src/SUMMARY.md | 1 + src/software/operating_system/nginx.md | 29 ++++++++++++++++++++++++++ 4 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 src/software/operating_system/nginx.md diff --git a/.gitignore b/.gitignore index 714c6f3..599bf1a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ book -notes src/tmp +notes diff --git a/notes b/notes index 5e3d362..0dd551a 100644 --- a/notes +++ b/notes @@ -1,5 +1,12 @@ notes. +29/06/2020 + + - todo: add styling conventions section + - code comments: Capitalized first word and period at the end. + +----- + chapter_1.md - Introduction diff --git a/src/SUMMARY.md b/src/SUMMARY.md index 1a01bf3..78419ea 100644 --- a/src/SUMMARY.md +++ b/src/SUMMARY.md @@ -9,6 +9,7 @@ - [Software](./software/index.md) - [Operating System](./software/operating_system/index.md) - [Networking](./software/operating_system/networking.md) + - [Nginx](./software/operating_system/nginx.md) - [Microservices](./software/microservices/index.md) - [peach-buttons](./software/microservices/peach-buttons.md) - [peach-menu](./software/microservices/peach-menu.md) diff --git a/src/software/operating_system/nginx.md b/src/software/operating_system/nginx.md new file mode 100644 index 0000000..9fc330f --- /dev/null +++ b/src/software/operating_system/nginx.md @@ -0,0 +1,29 @@ +# Nginx Configuration + +[Nginx](https://www.nginx.com/) is used as a reverse proxy for the `peach-web` application. Requests to `http://peach` and `http://www.peach` on port `80` are passed to the `peach-web` application on `http://127.0.0.1:3000`. + +The configuration file for `nginx` can be found at `/etc/nginx/sites-available/peach.conf`. The contents are as follows: + +``` +server { + listen 80; + server_name peach www.peach; + location / { + proxy_pass http://127.0.0.1:3000; + } +} +``` + +## Nginx Cheatsheet + +Symlink `sites-available/*.conf` to `sites-enabled/*.conf`: + +`sudo ln -s /etc/nginx/sites-available/peach.conf /etc/nginx/sites-enabled/` + +Check correctness of configuration: + +`sudo nginx -t` + +Reload nginx: + +`sudo nginx -s reload`