https://github.com/mpolinowski/nomadic-fileserver
Provisioning an HTTP Fileserver with Hashicorp Nomad
https://github.com/mpolinowski/nomadic-fileserver
fileserver hashicorp-nomad nginx
Last synced: 2 months ago
JSON representation
Provisioning an HTTP Fileserver with Hashicorp Nomad
- Host: GitHub
- URL: https://github.com/mpolinowski/nomadic-fileserver
- Owner: mpolinowski
- Created: 2022-12-02T10:54:02.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-12-02T10:56:05.000Z (over 3 years ago)
- Last Synced: 2025-10-06T14:42:14.887Z (9 months ago)
- Topics: fileserver, hashicorp-nomad, nginx
- Language: HCL
- Homepage:
- Size: 23.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Provisioning an HTTP Fileserver
Spin up an NGINX container with __Hashicorp Nomad__ that servers your files via HTTP. You will have to change the `server_name` to your domain or local IP. Run the job file and navigate your browser to port `8888`:
```bash
server {
listen 8080;
listen [::]:8080;
server_name my.domain.com;
location ~ /secret/.* {
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/conf.d/.htpasswd;
root /usr/share/nginx/html;
}
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
}
```
Nomad will create a text file in both the `/secret/` and `/public/` directory for testing:

## NGINX Server Configuration
Check [nginx_docker_ingress](https://github.com/mpolinowski/nginx_docker_ingress) on how to configure NGINX. The configuration is automatically generated by Nomad - but I did remove the TLS configuration for this example.
## Service Check
The uses Consul to verify that the web service is available - if you don't use either remove the `check` or switch the `provider` to `nomad`:
```bash
check {
name = "HTTP Health"
path = "/"
type = "http"
protocol = "http"
interval = "10s"
timeout = "2s"
}
```