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

Confirming Implementation of URLBASE and BASEPATH? #119

Open
brettpalmberg opened this issue Aug 1, 2022 · 9 comments
Open

Confirming Implementation of URLBASE and BASEPATH? #119

brettpalmberg opened this issue Aug 1, 2022 · 9 comments
Labels
design Design suggestion

Comments

@brettpalmberg
Copy link

brettpalmberg commented Aug 1, 2022

Question / Bug?

Hosting pg_featureserv at a non-root path required including the path parameter (e.g. /features) in both the UrlBase and BasePath config params to get URLs and JSON values to form correctly. It felt redundant to have to include the BasePath in both variables, but wanted to confirm whether this is the intended behavior before calling anything a bug.

Example (this works)

To host pg_featureserv at localhost:9000/features/ for example, the following environment variables are required to make all .html links and JSON-built urls work correctly:

What I expected (this does not work)

Thank you.

@brettpalmberg brettpalmberg changed the title Confirming Implementation of URLBASE and BASEPATH Confirming Implementation of URLBASE and BASEPATH? Aug 1, 2022
@brettpalmberg
Copy link
Author

Related to #109. I was able to confirm that the behavior of URLBASE and BASEPATH configuration parameters behave differently between pg_tileserv and pg_featureserv. pg_tileserv behaves as described in the section What I expected (this does not work) above.

@dr-jts dr-jts added the design Design suggestion label Aug 2, 2022
@dr-jts
Copy link
Collaborator

dr-jts commented Aug 2, 2022

Thanks, @brettpalmberg . I agree that having no redundancy between URLBASE and BASEPATH is desirable. And so is compatibility between pg_featureserv and pg_tileserv. We'll investigate making this change.

@brettpalmberg
Copy link
Author

Excellent, thanks for your response @dr-jts! Feel free to @ me if there's anything I can contribute. I wasn't familiar enough with the codebase just yet to be comfortable jumping-in :)

@rhewy
Copy link

rhewy commented Nov 7, 2022

Can these environment variables be passed to the docker container?

@pramsey
Copy link
Collaborator

pramsey commented Nov 7, 2022

Yes! Note that a Configuration.Variable will get converted into a PGFS_CONFIGURATION_VARIABLE if you catch my drift. There's a standard prefix (PGFS_) and everything gets caps'ed and underscored. But you can use normal environment variable passing to send the variable into docker or podman.

@rhewy
Copy link

rhewy commented Nov 7, 2022

So in a docker env file would I?
PGFS_SERVER_URLBASE=https://vm103.athena.bcit.ca/pgfs
PGFS_SERVER_BASEPATH=/pgfs

or

SERVER_URLBASE=https://vm103.athena.bcit.ca/pgfs
SERVER_BASEPATH=/pgfs

@pramsey
Copy link
Collaborator

pramsey commented Nov 7, 2022 via email

@rhewy
Copy link

rhewy commented Nov 7, 2022

So, I have nginx as the reverse proxy for https

        location /pgfs/ {
             proxy_pass http://localhost:9000/ ;
        }

Then https://vm103.athena.bcit.ca/pgfs is a 404
However
https://vm103.athena.bcit.ca/pgfs/pgfs/
Works

Then from the links on the collections page:
https://vm103.athena.bcit.ca/pgfs/pgfs/collections.html

The links are missing the second /pgfs/
https://vm103.athena.bcit.ca/pgfs/collections/public.becpas.html
404 error for the above

I will try some things ...

@rhewy
Copy link

rhewy commented Nov 7, 2022

This worked for me:

PGFS_SERVER_URLBASE=https://vm103.athena.bcit.ca/pgfs
PGFS_SERVER_BASEPATH=/

Home links work too

Thank you!

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

No branches or pull requests

4 participants