Commit 05ed40
2024-03-29 10:59:21 Arpan S.: -/-| /dev/null .. nginx related config.md | |
| @@ 0,0 1,26 @@ | |
| + | # Nginx Related Tips and Configurations |
| + | |
| + | For nginx, On most systems, |
| + | |
| + | ### Basic Nginx Config |
| + | |
| + | This is the most basic nginx config where `proxy_pass` & `server_name` values need to be modified and it should work in most applications. This config already passes the _real IP_ in the `proxy_set_header` value and it can be commented out by putting a `#` in the beginning of the line to _**disable**_. |
| + | |
| + | ``` |
| + | server { |
| + | listen 80; |
| + | server_name www.example.com example.com; |
| + | |
| + | location / { |
| + | |
| + | proxy_pass http://localhost:2000; |
| + | proxy_http_version 1.1; |
| + | proxy_set_header Upgrade $http_upgrade; |
| + | proxy_set_header Connection 'upgrade'; |
| + | proxy_set_header Host $host; |
| + | proxy_cache_bypass $http_upgrade; |
| + | proxy_set_header X-Forwarded-For $remote_addr; |
| + | } |
| + | |
| + | } |
| + | ``` |
