Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
|
reverse_proxy_server [2018/06/22 20:54] warmachine created |
reverse_proxy_server [2018/06/23 15:27] (current) warmachine |
||
|---|---|---|---|
| Line 8: | Line 8: | ||
| {{: | {{: | ||
| + | |||
| + | You'll need a linux machine of some sort for this. Reverse proxies are fairly lightweight so I would suggest spinning up a debian virt or utilizing a raspberry pi with raspbian if you want a physical proxy. This guide will assume your linux server is already setup, so if it isn't, head over to my ' | ||
| + | |||
| + | ssh to your linux server using your program of choice (secure CRT, MTputty, etc)\\ | ||
| + | |||
| + | use sudo for the commands if you are not logged in as root\\ | ||
| + | |||
| + | update linux and install nginx:\\ | ||
| + | |||
| + | <color # | ||
| + | apt-get install nginx</ | ||
| + | |||
| + | disable the default host:\\ | ||
| + | |||
| + | <color # | ||
| + | |||
| + | create your first host in the sites-available directory: | ||
| + | |||
| + | <color # | ||
| + | |||
| + | this will open the file editor, which you can paste this into:\\ | ||
| + | |||
| + | <color # | ||
| + | listen 80; \\ | ||
| + | location / { \\ | ||
| + | proxy_pass http:// | ||
| + | } \\ | ||
| + | } \\ | ||
| + | </ | ||
| + | control x, y (this exits nano and saves)\\ | ||
| + | |||
| + | We now create a symbolic link from the ' | ||
| + | |||
| + | |||
| + | <color # | ||
| + | |||
| + | test and restart nginx:\\ | ||
| + | |||
| + | <color # | ||
| + | service nginx restart</ | ||
| + | |||
| + | If all goes well, visiting the IP of your proxy server should result in being forwarded to your first host. If configtest returns errors, you will need to troubleshoot them, check your IPs, file names, and syntax of the commands you've run. \\ | ||
| + | |||
| + | If you add a dns entry (see dns section of wiki) and modify ' | ||
| + | |||
| + | <color # | ||
| + | listen 80; \\ | ||
| + | server_name your-first-hostname; | ||
| + | location / { \\ | ||
| + | proxy_pass http:// | ||
| + | } \\ | ||
| + | } \\ | ||
| + | </ | ||
| + | |||
| + | Now, visiting your-first-hostname (ie: iviolet.net) should hit your reverse proxy server, then forward to your-first-host. Note that this will only work internally, until you actually purchase and setup a domain name (see the domain name section of the wiki) and utilize either static IPs from your ISP, or more commonly --and cheaper, utilize dynamic DNS (also covered in the DNS section of the wiki). \\ | ||
| + | |||
| + | Once you've added a few different entries into your ' | ||
Last modified: le 2018/06/22 20:54
