I run horwood.cloud

Pixelfed

Could you help fund my server 👉 Fund me

  • 5 Posts
  • 314 Comments
Joined 2 years ago
cake
Cake day: July 27th, 2023

help-circle





  • apt/yum/dnf install nginx, listen on public IP of VPS, use proxy_pass to forward to your internal IP

    server {
        listen [::]:443 ssl;
        http2 on;
        server_name service.example.com;
        root /var/data/websites/holding;
        index index.php index.html index.htm;
    
        #SSL setting
        ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
        add_header X-Clacks-Overhead "GNU Terry Pratchett";
        add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
    
        # access_log /var/log/nginx/service-access.log main;
        access_log off;
    
        location / {
          proxy_http_version 1.1;
          proxy_set_header Upgrade $http_upgrade;
          proxy_set_header Connection "Upgrade";
          proxy_set_header X-Real-IP $remote_addr;
          proxy_set_header X-Forwarded-For $remote_addr;
          proxy_set_header X-Forwarded-Proto "https";
          proxy_set_header X-SECURE-REQUEST "true";
          proxy_set_header Host $http_host;
          proxy_pass http://192.168.1.2/; #IP of the service over the VPN
        }
    
    }
    













  • sure, you can see below that port 53 is only on a secondary IP I have on my docker host.

    ---
    services:
      pihole01:
        image: pihole/pihole:latest
        container_name: pihole01
        ports:
          - "8180:80/tcp"
          - "9443:443/tcp"
          - "192.168.1.156:53:53/tcp" # this will only bind to that IP
          - "192.168.1.156:53:53/udp" # this will only bind to that IP
          - "192.168.1.156:67:67/udp" # this will only bind to that IP
        environment:
          TZ: 'Europe/London'
          FTLCONF_webserver_api_password: 'mysecurepassword'
          FTLCONF_dns_listeningMode: 'all'
        dns:
          - '127.0.0.1'
          - '192.168.1.1'
        restart: unless-stopped
        labels:
            - "traefik.http.routers.pihole_primary.rule=Host(`dns01.example.com`)"
            - "traefik.http.routers.pihole_primary.service=pihole_primary"
            - "traefik.http.services.pihole_primary.loadbalancer.server.port=80"