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

No option to disable port appending when developing site on environment with a reverse proxy #2002

Closed
ProximaB opened this issue Oct 13, 2022 · 8 comments
Labels
done in pr Already done in a PR

Comments

@ProximaB
Copy link

ProximaB commented Oct 13, 2022

Bug Report

When using cloud development environment like gitpod.io, it allows exposing your ports via public links, behind the scene it uses a reverse proxy, that translate e.g. localhost:1234 into 1234-devenv.gitpod.io. That causes a problem because zola generated URLs that have port appended to it 1234-devenv.gitpod.io:1234/..., that of course makes the address invalid in that scenario. The resolution would be an ability to disable that behave with a flag on a serve command --appendPort=false. Hugo also support that option gohugoio/.../server.go

Environment

Zola version: 0.16.1

Expected Behavior

Do not append port to urls when requested.
Expected script to run on gitpod zola serve -p 1313 -i 0.0.0.0 -u $(gp url 1313) --appendPort false

Current Behavior

Appending ports behind gitpod reverse proxy makes URL invalid.

Step to reproduce

Open new workspace on gitpod.io (it's free), install zola with brew, init new zola project, zola serve -p 1313 -i 0.0.0.0 -u $(gp url 1313) --appendPort false

@ffrizzo
Copy link
Contributor

ffrizzo commented Oct 14, 2022

#2003

@Keats
Copy link
Collaborator

Keats commented Oct 15, 2022

If the option is only ever used for the negation, it makes more sense to have zola serve --no-port-appending instead (or whatever name is better)

@ProximaB
Copy link
Author

That’s true, but setting the parameter should be possible also through configuration.
Adding property to yaml appendPort: false seems to be follow current convention of sharing same names. But indeed it looks better for cli use

@Keats
Copy link
Collaborator

Keats commented Oct 16, 2022

but setting the parameter should be possible also through configuration.

It's not the case in zola. An option only for use in zola serve will not be available from the config file.

@ProximaB
Copy link
Author

I agree with you, it’s not the case with Zola. it’s has much more sense to use no-port-appending than appendPort with default true.

@ffrizzo
Copy link
Contributor

ffrizzo commented Oct 17, 2022

Interesting discussion. So we can tell the best option is to use --no-port-append?

@ProximaB
Copy link
Author

Yes, I think we have reached a consensus --no-port-append. Now It depends if it's ok with you and other contributors.

@ffrizzo
Copy link
Contributor

ffrizzo commented Oct 17, 2022

Sounds good to me. I will make propper changes on my PR

@Keats Keats added the done in pr Already done in a PR label Jan 12, 2023
@Keats Keats closed this as completed Feb 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
done in pr Already done in a PR
Projects
None yet
Development

No branches or pull requests

3 participants