Skip to content

Commit

Permalink
Split nginx config and tested with latest RPi OS.
Browse files Browse the repository at this point in the history
Tested with Raspberry Pi OS based on Debian version: 11 (bullseye)
Split nginx configuration into two files to separate the captive portal site from the content site. This allows for easier customization of the content site.
  • Loading branch information
jerryryle committed Mar 23, 2023
1 parent a13ac0c commit b30a444
Show file tree
Hide file tree
Showing 10 changed files with 125 additions and 81 deletions.
9 changes: 9 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
rogueportal (1.4) stable; urgency=medium

* Tested with Raspberry Pi OS based on Debian version: 11 (bullseye)
* Split nginx configuration into two files to separate the captive portal site
from the content site. This allows for easier customization of the content
site.

-- Jerry Ryle <[email protected]> Thu, 23 Mar 2023 11:20:00 -0800

rogueportal (1.3) buster; urgency=medium

* Added support for RFC 8910 (https://datatracker.ietf.org/doc/html/rfc8910)
Expand Down
2 changes: 1 addition & 1 deletion debian/copyright
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Upstream-Name: rogueportal
Source:

Files: *
Copyright: 2020-2021 Jerry Ryle
Copyright: 2020-2023 Jerry Ryle
License: BSD-3-clause

License: BSD-3-clause
Expand Down
1 change: 1 addition & 0 deletions debian/rogueportal.postinst
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ case "$1" in

systemctl enable dnsmasq

ln -s /etc/nginx/sites-available/roguecontent.rogueportal /etc/nginx/sites-enabled/roguecontent
service nginx reload
;;

Expand Down
3 changes: 3 additions & 0 deletions debian/rogueportal.postrm
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ set -e
case "$1" in
purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
systemctl enable wpa_supplicant

rm -f /etc/nginx/sites-enabled/roguecontent
service nginx reload
;;

*)
Expand Down
135 changes: 83 additions & 52 deletions docs/index.md

Large diffs are not rendered by default.

Binary file added docs/rpi-imager-screenshot-01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/rpi-imager-screenshot-02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/rpi-imager-screenshot-03.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 0 additions & 28 deletions files/rogueportal/etc/nginx/sites-available/default.rogueportal
Original file line number Diff line number Diff line change
@@ -1,31 +1,3 @@
# The go.rogueportal server
# This handles any request that includes go.rogueportal as the server name.
server {
listen 80;
listen [::]:80;
server_name go.rogueportal;

# Only allow GET, HEAD, POST
if ($request_method !~ ^(GET|HEAD|POST)$) { return 444; }

# Logs
access_log /var/log/nginx/rogueportal.access.log;
error_log /var/log/nginx/rogueportal.error.log warn;

root /var/www/html;

index index.html;

location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}

# Redirect these errors to the home page.
error_page 401 403 404 =200 /index.html;
}

# Default server configuration
# This handles any request not made using the go.rogueportal server name and
# serves a redirect to go.rogueportal.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# The go.rogueportal server
# This handles any request that includes go.rogueportal as the server name.
# You can update this to serve your own content, proxy to another server, etc.
server {
listen 80;
listen [::]:80;
server_name go.rogueportal;

# Only allow GET, HEAD, POST
if ($request_method !~ ^(GET|HEAD|POST)$) { return 444; }

# Logs
access_log /var/log/nginx/rogueportal.access.log;
error_log /var/log/nginx/rogueportal.error.log warn;

root /var/www/html;

index index.html;

location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}

# Redirect these errors to the home page.
error_page 401 403 404 =200 /index.html;
}

0 comments on commit b30a444

Please sign in to comment.