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

reverse proxy support for local development #875

Closed
galki opened this issue Nov 4, 2018 · 5 comments
Closed

reverse proxy support for local development #875

galki opened this issue Nov 4, 2018 · 5 comments
Labels
outdated scope: node Issues related to Node, Express, NestJS support for Nx stale type: feature

Comments

@galki
Copy link

galki commented Nov 4, 2018

nx is about shared code and multiple apps. that means that for example, ports in development usually translate to subdomains in production. with some solutions (firebase) requiring ssl during development as well, a built-in, local certificate-generating reverse proxy may be considered a popular and helpful feature.

@galki galki changed the title reverse proxy support for development reverse proxy support for local development Nov 4, 2018
@galki
Copy link
Author

galki commented Nov 15, 2018

the way i currently do it on xplat (to be clear xplat doesn't come with this feature) is with these scripts:

"generate.proxy.cert": "node proxy/cert/generate",
"proxy": "node proxy/proxy",
"start.web.app": "ng serve web-app --host mydomain.localhost --port=4200"
"start.web.app2": "ng serve web-app --host subdomain.mydomain.localhost --port=4201"
  1. generate.proxy.cert generates an ssl cert for proxy for mydomain.localhost (optional)
  2. proxy reads package.json and extracts the hosts and ports of all apps to create a reverse-proxy with http-proxy

im using firebase functions for the backend so i hard code *.mydomain.localhost/api/ to redirect to localhost:5000/mydomain/us-central1/api (an express app firebase function served locally). per-app backend functionality can also be added.

using the --host flag doesnt interfere with default serving but seems to be required for reverse-proxy serving.

@galki
Copy link
Author

galki commented Nov 19, 2018

used this chance to learn a bit about schematics: https://github.com/unitedhubs/reverse-proxy-schematic although not even sure how to exec the schematic after npm i -D reverse-proxy-schematic

@vsavkin vsavkin added the scope: node Issues related to Node, Express, NestJS support for Nx label Dec 4, 2019
@github-actions github-actions bot added the stale label May 29, 2020
@nrwl nrwl deleted a comment from github-actions bot May 29, 2020
@FrozenPandaz
Copy link
Collaborator

Hi, sorry about this.

This was mislabeled as stale. We are testing ways to mark not reproducible issues as stale so that we can focus on actionable items but our initial experiment was too broad and unintentionally labeled this issue as stale.

@github-actions
Copy link

github-actions bot commented Feb 3, 2021

This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs.
If we missed this issue please reply to keep it active.
Thanks for being a part of the Nx community! 🙏

@github-actions
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated scope: node Issues related to Node, Express, NestJS support for Nx stale type: feature
Projects
None yet
Development

No branches or pull requests

4 participants