An open API service indexing awesome lists of open source software.

https://github.com/jwillikers/nginx-config

NGINX configuration files for services on running on my various devices.
https://github.com/jwillikers/nginx-config

config nginx podman proxy reverse-proxy

Last synced: about 1 year ago
JSON representation

NGINX configuration files for services on running on my various devices.

Awesome Lists containing this project

README

          

= NGINX Config
Jordan Williams
:experimental:
:icons: font
ifdef::env-github[]
:tip-caption: :bulb:
:note-caption: :information_source:
:important-caption: :heavy_exclamation_mark:
:caution-caption: :fire:
:warning-caption: :warning:
endif::[]
:Asciidoctor_: https://asciidoctor.org/[Asciidoctor]
:NGINX: https://www.nginx.com/[NGINX]
:Fedora-IoT: https://getfedora.org/en/iot/[Fedora IoT]
:Podman: https://podman.io/[Podman]
:pre-commit: https://pre-commit.com/[pre-commit]

image:https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white[pre-commit, link=https://github.com/pre-commit/pre-commit]

{NGINX} configuration files for services on running on my various devices.

== Synopsis

These instructions are for using this NGINX configuration via a container using rootless {Podman} on {Fedora-IoT}.
The instructions for building will assume that you are on Fedora.

== Usage

. Allow rootless containers to publish to ports 80 and 443 by lowering the starting port for the range of unprivileged ports to which users are allowed to publish.
+
./etc/sysctl.d/99-ip_unprivileged_port_start.conf
[,ini]
----
; Allow publishing to lower port numbers without requiring superuser privileges.
net.ipv4.ip_unprivileged_port_start=80
----

. Load the new sysctl configuration.
+
[,sh]
----
sudo sysctl --system
----

. Open the default HTTP and HTTPS ports in the firewall, since rootless Podman won't be able to open this for us.
+
[,sh]
----
sudo firewall-cmd --add-port=80/tcp --add-port=443/tcp --permanent
----

. Reload the firewall rules that were just saved.
+
[,sh]
----
sudo firewall-cmd --reload
----

. Clone the repository.
+
[,sh]
----
git clone git@codeberg.org:jwillikers/nginx-config.git
----

. Change into the project directory.
+
[,sh]
----
cd nginx-config
----

. Symlink sites from the `sites-available` subdirectory to the `sites-enabled` subdirectory to enable them.
+
[,sh]
----
ln --relative --symbolic sites-available/electrs.conf sites-enabled/electrs.conf
----

. Mount the configuration files inside the NGINX container when running like in the following example.
+
[,sh]
----
podman run \
--detach \
--label "io.containers.autoupdate=registry" \
--network systemd-podman \
--name nginx \
--publish 80:80/tcp \
--publish 443:443/tcp \
--rm \
--volume $PWD:/etc/nginx/:ro,Z \
--volume certbot-certificates:/etc/nginx/ssl:ro,z \
docker.io/nginx:latest
----

== Develop

. Install the pre-commit in the toolbox.
+
[,sh]
----
sudo dnf -y install pre-commit
----

. Install pre-commit's Git hooks.
+
[,sh]
----
pre-commit install
----

== Contributing

Contributions in the form of issues, feedback, and even pull requests are welcome.
Make sure to adhere to the project's link:CODE_OF_CONDUCT.adoc[Code of Conduct].

== Open Source Software

This project is built on the hard work of countless open source contributors.
Several of these projects are enumerated below.

* {Asciidoctor_}
* {Fedora-IoT}
* {NGINX}
* {Podman}
* {pre-commit}

== Code of Conduct

Refer to the project's link:CODE_OF_CONDUCT.adoc[Code of Conduct] for details.

== License

This repository is licensed under the https://www.gnu.org/licenses/gpl-3.0.html[GPLv3], a copy of which is provided in the link:LICENSE.adoc[license file].

© 2023-2024 Jordan Williams

== Authors

mailto:{email}[{author}]