Skip to content
GitLab
    • Explore Projects Groups Snippets
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • N node-http-proxy
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 482
    • Issues 482
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 102
    • Merge requests 102
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • http ... PARTY!
  • node-http-proxy
  • Issues
  • #839
Something went wrong while setting issue due date.
Closed
Open
Issue created 10 years ago by Administrator@rootContributor
  • New related issue

  • Report abuse to administrator

  • New related issue

  • Report abuse to administrator

Ignore path and the trailing slash

Closed

Ignore path and the trailing slash

Created by: mereghost

As I need to rewrite the request URL as it does not map perfectly to the applications under the proxy, I've set ignorePath to true.

Then I proceeded to define the target as a full doctored url (a valid URL for my applications), but as in common.js:82 it does not truly ignore the path. It sets it to '/' and them proceeds to append it to target / forward.

Is there any way around that? Is there a better way to do what I need?

An error occurred while loading designs. Please try again.
Tasks
0
server returned results with length 1, expected length of 9

Linked items
0

Link issues together to show that they're related. Learn more.

Activity


  • Administrator
    Administrator @root · 10 years ago
    Author Contributor

    Created by: mereghost

    Hmmm... the only current way (that I found) to bypass this behavior is rewriting the proxied request path using the callback 'proxyReq'

    proxy.on('proxyReq', function (proxyReq, req, res, options) {
        proxyReq.path = path;
    });
  • Administrator
    Administrator @root · 9 years ago
    Author Contributor

    Created by: bdefore

    thanks @mereghost i was looking for just this. to prepend, you can do i.e. proxyReq.path = '/api/' + proxyReq.path. certainly would be nicer if ignorePath was better documented.

  • Administrator
    Administrator @root · 9 years ago
    Author Contributor

    Created by: cdl

    Thanks @mereghost - just ran into this issue myself, but it didn't surface until dealing with proxying requests with query parameters. Glad to see I'm not going insane. :thumbsup:

  • Administrator
    Administrator @root · 9 years ago
    Author Contributor

    Created by: RickWong

    :thumbsup:

  • Administrator
    Administrator @root · 9 years ago
    Author Contributor

    Created by: darrenmce

    :thumbsup: / appended to end of querystring when using ignorePath

  • Administrator
    Administrator @root · 9 years ago
    Author Contributor

    Created by: 75lb

    i need to rewrite the target path too for the exact same reason (the target URL structure does not match the source URL structure).

    this appended trailing slash breaks the ability to rewrite the target path as a specific resource.. could we remove it and update the docs for ignorePath stating that, if required, we must manually append our own target trailing slash?

  • Administrator
    Administrator @root · 9 years ago
    Author Contributor

    Created by: niclic

    Should be resolved by this: https://github.com/nodejitsu/node-http-proxy/pull/934

  • Administrator
    Administrator @root · 9 years ago
    Author Contributor

    Created by: jcrugzz

    @niclic should be, thanks :)

Please register or sign in to reply
0 Assignees
None
Assign to
Labels
0
None
0
None
    Assign labels
  • Manage project labels

Milestone
No milestone
None
Due date
None
None
None
Time tracking
No estimate or time spent
Confidentiality
Not confidential
Not confidential

You are going to turn on confidentiality. Only project members with at least the Reporter role, the author, and assignees can view or be notified about this issue.

Lock issue
Unlocked
0
0 participants
Reference:

Menu

Explore Projects Groups Snippets