Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| howto:nginx [2022/01/15 22:40] – created Xerxes | howto:nginx [2022/01/17 07:18] (current) – add non root url example ragnarok | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== How to use nginx as a Reverse Proxy with Synchronet ====== | ====== How to use nginx as a Reverse Proxy with Synchronet ====== | ||
| - | nignx is a popular multiplatform web server and reverse proxy. | + | nignx is a popular multiplatform web server and reverse proxy. |
| ===== Configuring nginx with SSL ===== | ===== Configuring nginx with SSL ===== | ||
| Line 7: | Line 7: | ||
| Here is an example configuration for proxying to the machine on your network (in this example 10.0.0.10) with Synchronet BBS Webserver: | Here is an example configuration for proxying to the machine on your network (in this example 10.0.0.10) with Synchronet BBS Webserver: | ||
| - | | + | |
| listen | listen | ||
| server_name | server_name | ||
| - | location / { | + | |
| - | proxy_set_header X-Real-IP $remote_addr; | + | proxy_set_header X-Real-IP $remote_addr; |
| - | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | + | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
| - | proxy_set_header Host $http_host; | + | proxy_set_header Host $http_host; |
| - | proxy_set_header X-Forwarded-Proto $scheme; | + | proxy_set_header X-Forwarded-Proto $scheme; |
| - | proxy_pass | + | proxy_pass |
| - | | + | } |
| - | | + | ssl_certificate |
| - | | + | ssl_certificate_key |
| - | | + | ssl_session_cache |
| - | | + | ssl_session_timeout |
| - | | + | ssl_prefer_server_ciphers |
| - | | + | ssl_protocols |
| - | | + | ssl_ciphers |
| } | } | ||
| Line 32: | Line 32: | ||
| Here is an example configuration for proxying to WS: | Here is an example configuration for proxying to WS: | ||
| - | | + | |
| - | listen | + | |
| - | | + | |
| - | proxy_set_header X-Real-IP $remote_addr; | + | |
| - | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | + | |
| - | proxy_set_header Host $http_host; | + | |
| - | proxy_set_header X-Forwarded-Proto $scheme; | + | |
| - | proxy_pass | + | |
| - | | + | |
| | | ||
| | | ||
| Line 51: | Line 51: | ||
| While this is a working configuration, | While this is a working configuration, | ||
| + | |||
| + | Additionally, | ||
| + | |||
| + | keepalive_timeout | ||
| + | | ||
| + | This will cause the fTelnet to timeout (regardless if you are using fTelnet proxy or not). | ||
| + | |||
| + | ===== Using synchronet on non-root url ===== | ||
| + | |||
| + | Example for run sbbs on /webbbs url | ||
| + | |||
| + | |||
| + | location ^~ /webbbs { | ||
| + | try_files $uri @app; | ||
| + | } | ||
| + | location @app { | ||
| + | proxy_set_header Host $host; | ||
| + | proxy_set_header X-Real-IP | ||
| + | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
| + | proxy_pass http:// | ||
| + | proxy_redirect off; | ||
| + | rewrite /webbbs(.*) /$1 break; | ||
| + | } | ||
| + | # api call seems to be absolute, so you must alias /api/ url's | ||
| + | location /api/ { | ||
| + | proxy_set_header X-Real-IP | ||
| + | proxy_set_header X-Forwarded-For $remote_addr; | ||
| + | proxy_set_header Host $host; | ||
| + | proxy_pass http:// | ||
| + | } | ||
| + | |||
| + | | ||
| + | |||
| + | |||
| ===== See Also ===== | ===== See Also ===== | ||