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

Add Tutorial around using tegola behind a proxy #35

Open
ARolek opened this issue Apr 22, 2019 · 1 comment
Open

Add Tutorial around using tegola behind a proxy #35

ARolek opened this issue Apr 22, 2019 · 1 comment

Comments

@ARolek
Copy link
Member

ARolek commented Apr 22, 2019

Not all deployments of tegola allow for binding to a specific port. Nginx and HAProxy are often used in front of tegola. It would be nice to have some tutorial documentation around this.

@brightrain
Copy link

Happy to share the nginx config that we got working (ht @ARolek for the help here). This is the nginx site configuration that is working for us. The main site is being served from our domain root and we are also serving out vector tiles from tegola on localhost:8080 and making them available via our domain at:

example.com/tiles

config using example.com as the domain

server {
        listen 80;
        listen [::]:80;

        root /var/www/example/html;
        index index.html index.htm index.nginx-debian.html;

        server_name example.com www.example.com;

        location / {
                alias /var/www/example/html/public/;
                try_files $uri $uri/ =404;
        }
       
        location /tiles/ {
            proxy_pass http://127.0.0.1:8080/;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection 'upgrade';
            proxy_set_header Host $host;
            proxy_cache_bypass $http_upgrade;
        }
}

FYI for anyone doing this, that last slash in the proxy_pass property value turned out to be the critical piece

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

2 participants