No edit summary |
No edit summary |
||
Line 28: | Line 28: | ||
Simple http configuration: | Simple http configuration: | ||
server { | <pre> | ||
# listen to http on port 80 | server { | ||
listen 80; | # listen to http on port 80 | ||
listen [::]:80; | listen 80; | ||
# listen to url | listen [::]:80; | ||
server_name servpub.net; | # listen to url | ||
server_name servpub.net; | |||
# linking the client to the vpn subnet ip address of the pi | # linking the client to the vpn subnet ip address of the pi | ||
location / {<br> | location / {<br> | ||
proxy_set_header Host $host; | proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For | proxy_set_header X-Forwarded-For | ||
$proxy_add_x_forwarded_for; | $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | proxy_set_header X-Forwarded-Proto $scheme; | ||
# replace this with the user vpn subnet ip address you set earlier | # replace this with the user vpn subnet ip address you set earlier | ||
proxy_pass http://10.10.12.51; | proxy_pass http://10.10.12.51; | ||
proxy_read_timeout 90; | proxy_read_timeout 90; | ||
} | } | ||
location / { | location / { | ||
rewrite ^ https://$host$request_uri? permanent; | rewrite ^ https://$host$request_uri? permanent; | ||
} | } | ||
} | } | ||
</pre> | |||
''Fragment from Servpub Docs [see page 2]'' | ''Fragment from Servpub Docs [see page 2]'' | ||
Revision as of 14:09, 1 February 2024
Nginx Reverse Proxy Configuration
Add a nginx config file at "/etc/nginx/sites-available/<SERVERNAME>.conf". To do this use the commands:
$ cd /ect/nginx/
$ nano sites-available/<NETNAME>.conf
Ours looks like this:
$ cd /ect/nginx/
$ nano sites-available/systerserver.conf
Choosing your NGINX reverse proxy setup is very much up to you. You can create a simple one with just http, and a more secure and standard one with https redirect and certificate.
Simple http configuration:
server { # listen to http on port 80 listen 80; listen [::]:80; # listen to url server_name servpub.net; # linking the client to the vpn subnet ip address of the pi location / {<br> proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; # replace this with the user vpn subnet ip address you set earlier proxy_pass http://10.10.12.51; proxy_read_timeout 90; } location / { rewrite ^ https://$host$request_uri? permanent; } }
Fragment from Servpub Docs [see page 2]