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

www/caddy Specify listening port #4065

Closed
3 tasks done
PacFox opened this issue Jun 28, 2024 · 6 comments · Fixed by #4069
Closed
3 tasks done

www/caddy Specify listening port #4065

PacFox opened this issue Jun 28, 2024 · 6 comments · Fixed by #4069

Comments

@PacFox
Copy link

PacFox commented Jun 28, 2024

Important notices
Before you add a new report, we ask you kindly to acknowledge the following:

Is your feature request related to a problem? Please describe.
I saw from the Caddy documentation (https://caddyserver.com/docs/caddyfile/options#https-port) that it should be possible to change the ports it will listen on in the Caddyfile however when installed in Opnsense it's commented as auto-generated.

Describe the solution you'd like
I would like to be able to set the Caddy's HTTPS and HTTP listening ports similar to how you can with Unbound's DNS listening port.

Describe alternatives you've considered
I thought about using a container to run it separately where I'd have full control though it would be better if it could just run whenever the router is running.

@Monviech
Copy link
Member

Monviech commented Jun 28, 2024

You can use import statements to change whatever you want. Here is an example:

https://docs.opnsense.org/manual/how-tos/caddy.html#advanced-bind-caddy-to-specific-interface

https://docs.opnsense.org/manual/how-tos/caddy.html#using-custom-configuration-files

Edit:
You would have to explain to me why you would want that. What is the usecase to run the Caddy ports on 8080 and 8443 for example?

You would need to port forward port 80 and 443 to 8080 and 8443 then, which makes the point to change these ports moot.

@PacFox
Copy link
Author

PacFox commented Jun 28, 2024

@Monviech Thanks for the info, not sure how I missed reading about adding custom config files but I've now got it sorted to the use the specific ports. My main reason is that I wanted the local hostname/ip to go still to Opnsense dashboard (without specifying ports) and only the external domains through the reverse proxy. Nevertheless as it's working now I'll close this request.

@PacFox PacFox closed this as completed Jun 28, 2024
@Monviech
Copy link
Member

Monviech commented Jun 28, 2024

@PacFox Oh okay. Great that you got it working. When more people request it in the future I might add it to the GUI. I'm just a little reluctant about it, just as with offering binding to a specific IP address, since I have a high priority to avoid unintended user error.

EDIT:
This can also be valid option if the WebGUI should still respond on 443:

https://docs.opnsense.org/manual/how-tos/caddy.html#reverse-proxy-the-opnsense-webgui

@PacFox
Copy link
Author

PacFox commented Jun 28, 2024

@Monviech That's fair enough, never any fun running into that. Thanks very much for your time and knowledge with this all.

@Monviech
Copy link
Member

@PacFox I have looked at it again and see no reason not to offer it in the GUI. I have attached a PR.

@PacFox
Copy link
Author

PacFox commented Jul 2, 2024

Thanks @Monviech, I'll try it out once the next update is out.

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

Successfully merging a pull request may close this issue.

2 participants