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

feat(web): allow unsecure ssl proxy on file-server #7449

Conversation

yannickglt
Copy link
Contributor

Thanks to http-party/http-server#688 released in v14, it's now possible to forward proxy options to http-server.

It's useful for Nx as the @nrwl/web:file-server executor uses it. This pull request aims to fix an issue related to this executor while a self-signed certificate is used.

Example of @nrwl/web:file-server configuration using secure: false proxy option.

    "serve": {
      "executor": "@nrwl/web:file-server",
      "configurations": {
        "production": {
          "buildTarget": "demo:build:production"
        }
      },
      "options": {
        "buildTarget": "demo:build",
        "host": "local.demo.io",
        "port": 4207,
        "proxyUrl": "https://local.demo.io:4207?", // Fixes 404 on refresh as proposed in https://github.com/nrwl/nx/issues/5118
        "secure": false, // The new option making HTTPs works on refresh
        "ssl": true,
        "sslCert": "demo.crt",
        "sslKey": "demo.key"
      }
    }

My proposal simply add a secure boolean option in the schema, but maybe you prefer a dedicated entry for proxy-options as supported by the [https://github.com/http-party/node-http-proxy#options][node-http-proxy] library.

Current Behavior

Using a proxyUrl on a @nrwl/web:file-server executor does not work because of security purpose.

Expected Behavior

@nrwl/web:file-server is expected to be used for development only and is most of the time given a self-signed certificate.

Related Issue(s)

#5118

@vercel
Copy link

vercel bot commented Oct 20, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/nrwl/nx-dev/Aq7Ggt1NKSSjEUmWMfvrSuXoBBQD
✅ Preview: https://nx-dev-git-fork-yannickglt-feat-file-serverallow-un-eb1bf3-nrwl.vercel.app

@nx-cloud
Copy link

nx-cloud bot commented Dec 13, 2021

Nx Cloud Report

CI is running for commit 1955462.

📂 Click to track the progress, see the status, the terminal output, and the build insights.


Sent with 💌 from NxCloud.

Fix usage of self-signed certificates while using a proxy in file-server executor.

  See nrwl#5118
@yannickglt
Copy link
Contributor Author

Hi @jaysoo,
Sorry for pinging, but do you know why the build job is still "waiting for status to be reported"? Is there something I did wrong with this pull request?
Thanks

@yannickglt
Copy link
Contributor Author

Closed in favor of #9225

@yannickglt yannickglt closed this Apr 6, 2022
auto-merge was automatically disabled April 6, 2022 12:44

Pull request was closed

@yannickglt yannickglt deleted the feat/file-server/allow-unsecure-ssl-proxy branch April 6, 2022 12:44
@github-actions
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants