Hi @natebass
Yeah it was me
So here is my farmOS docker-compose.yml:
version: '3'
services:
www:
image: farmos/farmos:2.0.0-beta1
volumes:
- './sites:/opt/drupal/web/sites'
ports:
- '8090:80'
restart: always
db:
image: postgres:12
volumes:
- './db:/var/lib/postgresql/data'
environment:
POSTGRES_USER: someuser
POSTGRES_PASSWORD: somepassword
POSTGRES_DB: somedatabase
So very basic stuff. The database is only connected to farmOS and can not be accessed from the internet directly. I redirected farmOS to 8090 because I run multiple services on this server, for example, a GeoServer (@jgaehring This could be content for the tutorial segment).
In the Nginx configuration located in /etc/nginx/sites-available/your.url
I created this server besides the standard (route everything from HTTP to https):
server {
server_name farmos.your.url;
listen 443 ssl;
ssl_certificate /etc/letsencrypt/live/your.url/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/your.url/privkey.pem;
location / {
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
proxy_pass http://localhost:8090;
}
}
This was what I took from the farmOS.org-page.
For SSL I´m using certbot, which is pretty easy to install:
I use certbot to get one wildcard for all my subdomains. So there is one cert for everything.
This is like the stuff I wrote done in my notes (I expect certbot and nginx are installed fresh):
Difiie-Hellman Key (something for SSL):
sudo openssl dhparam -out /etc/ssl/certs/dhparam.pem 2048
Create some NGINX configuration files:
sudo cp /etc/nginx/sites-available/default /etc/nginx/sites-available/example.com
sudo ln -s /etc/nginx/sites-available/example.com /etc/nginx/sites-enabled/example.com
sudo rm /etc/nginx/sites-enabled/default
sudo rm /etc/nginx/sites-available/default
Add these DNS Settings to your Domain:
A-Record * IP
A-Record @ IP
C-NAME www @
Get your SSL Cert:
sudo certbot --server https://acme-v02.api.letsencrypt.org/directory -d *.example.com --manual --preferred-challenges dns-01 certonly
The above command will at some point prompt you to deploy a DNS TXT Record. Copy the value and make a TXT-Record for _acme-challenge.example.com with the value you just copied!
Create your base configuration:
sudo nano /etc/nginx/sites-available/example.com
This should be still up to date. The problem is you have to manually update your certs if you are doing it this way. But there are plugins for many url-providers so that the whole renew a certificate process can be renewed. For my personal server for example I use this one: GitHub - helgeerbe/certbot-dns-ionos: A certbot plugin for enabling DNS authentication with IONOS
If you are lucky. Someone may already have created one for your provider. What these are basically doing is, calling the API of your provider and changing the _acme-challenge.example.com DNS-Record automatically so you do not have to do it.
If you need more information about nginx and standard configuration just reply. Not sure how deep I should go
I don´t know what you got so for and where I can help but I´m happy if I can help