Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Datasette on docker with SWAG as reverse proxy? #2256

Open
amca01 opened this issue Feb 7, 2024 · 0 comments
Open

Datasette on docker with SWAG as reverse proxy? #2256

amca01 opened this issue Feb 7, 2024 · 0 comments

Comments

@amca01
Copy link

amca01 commented Feb 7, 2024

Since I've switched to SWAG (from linuxserver.io) for my reverse proxy needs, including managing letsencrypt certificates, I tried to build a proxy configuration file for Datasette. The relevant part of my docker-compose.yml file is

  datasette:
    image: datasetteproject/datasette
    container_name: datasette
    ports:
      - "8001:8001"
    volumes:
      - /home/me/Docker/Datasette:/mnt

and the datasette.subdomain.conf file is

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;

    server_name datasette.*;

    include /config/nginx/ssl.conf;

    client_max_body_size 0;

    location {
        include /config/nginx/proxy.conf;
        include /config/nginx/resolver.conf;
        set $upstream_app datasette;
        set $upstream_port 8001;
        set $upstream_proto http;
        proxy_pass $upstream_proto://$upstream_app:$upstream_port;
    }
}

This sort of setup works fine with some other containers. Note that I have already set up a datasette subdomain with my domain name registrar.

However, my attempts to access the subdomain result in the nginx "502 Bad Gateway" error.

When I investigate swag/keys/cert.crt with openssl, one of the DNS subdomains listed is indeed datasette.mysite.org. (Where mysite.org is the stand in for my real site name.)

Anyway, if anybody has got docker+datasette+SWAG working, I'd love to know how it was done! I installed Datasette locally, and I liked it very much. But I would like to offer the database and its search facilities to others; thus on my remote VPS. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant