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 caddy config #106

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

add caddy config #106

wants to merge 1 commit into from

Conversation

paulwalko
Copy link

Description

Add caddy configuration for reference

I had been using this config for quite a while using the Dockerfile at https://docs.qgis.org/3.34/en/docs/server_manual/containerized_deployment.html with no issue.

I have verified this works following the url structure https://example.com/qgis_mapserv.fcgi?SERVICE=WMTS&REQUEST=GetCapabilities&MAP=/io/data/test/test.qgz with the ltr tag.

@JakobMiksch
Copy link
Contributor

JakobMiksch commented May 16, 2024

@paulwalko just to understand this correctly. In this example you would not use NGINX at all and use Caddy instead?

@paulwalko
Copy link
Author

Yes, that's correct. In my testing qgis-server was run with the SKIP_NGINX=true env var

@mbernasocchi
Copy link
Member

@paulwalko Thanks; I also prefer Caddyfiles, but is the committed Caddyfile functional? it looks a bit too skinny (isn't local_certs, file_server root, and maybe env QUER_STRING missing).

I usually use https://github.com/opengisch/micro-sdi/blob/master/conf/Caddyfile as a minimal version (it could for sure be reduced to remove the matches.

@paulwalko
Copy link
Author

@paulwalko Thanks; I also prefer Caddyfiles, but is the committed Caddyfile functional? it looks a bit too skinny (isn't local_certs, file_server root, and maybe env QUER_STRING missing).

I usually use https://github.com/opengisch/micro-sdi/blob/master/conf/Caddyfile as a minimal version (it could for sure be reduced to remove the matches.

Global config can vary widely based on user preference. In my case the domain is externally available so the local_certs property (or any global config) is not needed at all. I'll add a comment about that in the readme.

The QUERY_STRING parameter (and many others) is already passed by default in caddy: https://github.com/caddyserver/caddy/blob/2ce5c6526938b604586c987fa3d31117721e40a6/modules/caddyhttp/reverseproxy/fastcgi/fastcgi.go#L299

As for the other configuration in the Caddyfile you linked, I'm wondering is that necessarily required? If all the functionality works without it I could see that causing more confusion than intended.

@mbernasocchi
Copy link
Member

Global config can vary widely based on user preference. In my case the domain is externally available so the local_certs property (or any global config) is not needed at all. I'll add a comment about that in the readme.
Perfect,

As for the other configuration in the Caddyfile you linked, I'm wondering is that necessarily required? If all the functionality works without it I could see that causing more confusion than intended.

As I said, it could be reduced, but the way you setup the Caddyfile does not mimic the NGINX config which offers nice urls (

rewrite ^/ogc/(.*)$ /qgis/qgis_mapserv.fcgi?map=/io/data/$1/$1.qgs;
)

I think Ideally we should try to keep those (or remove them in NGINX) but not have 2 different entry points. I'd prefer having the /ogc entrypoint in Caddy as well.

@paulwalko
Copy link
Author

Alright, I think it should be good to go now. Admittedly I don't have much experience using the services except for WMTS, but the other endpoints seem to be very similar (using your provided file as reference), they just have a different path prefix.

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

Successfully merging this pull request may close these issues.

None yet

3 participants