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

zuul.stripPrefix=false not work for all route? #1365

Closed
Dreampie opened this Issue Sep 28, 2016 · 9 comments

Comments

Projects
None yet
6 participants
@Dreampie
Copy link

Dreampie commented Sep 28, 2016

//work fine

zuul:
  routes:
    user-api-provider:
      path: /usr/**
      stripPrefix: false
    common-api-provider:
      path: /cmn/**
      stripPrefix: false
    log-api-provider:
      path: /log/**
      stripPrefix: false
    ddcms-api-provider:
      path: /ddcms/**
      stripPrefix: false
    area-api-provider:
      path: /are/**
      stripPrefix: false
    limit-api-provider:
      path: /lmt/**
      stripPrefix: false

//not work

zuul:
  stripPrefix: false
  routes:
    user-api-provider: /usr/**
    area-api-provider: /are/**
    limit-api-provider: /lmt/**
    log-api-provider: /log/**
    common-api-provider: /cmn/**
    ddcms-api-provider: /ddcms/**
@asarkar

This comment has been minimized.

Copy link
Contributor

asarkar commented Sep 29, 2016

Can you provide more details than "not work"? What do you expect and what do you see?

@Dreampie

This comment has been minimized.

Copy link
Author

Dreampie commented Sep 29, 2016

in second way,/usr/users forward was /users,lost /usr

@spencergibb

This comment has been minimized.

Copy link
Member

spencergibb commented Oct 3, 2016

zuul.stripPrefix specifically applies to zuul.prefix. zuul.routes.<route>.stripPrefix applies to zuul.routes.<route>.path

@spencergibb spencergibb closed this Oct 3, 2016

@spencergibb spencergibb added the question label Oct 3, 2016

ryanjbaxter added a commit that referenced this issue Oct 3, 2016

Clarified zuul.stripPrefix usage
Helps with the confusion seen in #1365
@ryanjbaxter

This comment has been minimized.

Copy link
Contributor

ryanjbaxter commented Oct 3, 2016

I added a note to the documentation to clarify its usage in commit 4ba3411

@elnur

This comment has been minimized.

Copy link

elnur commented Mar 13, 2017

@ryanjbaxter there seems to be a typo in that note and it confuses the hell out of me. 😛

@spencergibb

This comment has been minimized.

Copy link
Member

spencergibb commented Mar 13, 2017

Please, only constructive comments. What confuses you about the documentation?

@amarkavtsov

This comment has been minimized.

Copy link

amarkavtsov commented Mar 21, 2017

I had similar issue. Ended up with overriding Route locator logic:

@Bean
	@Primary
	public DiscoveryClientRouteLocator getRouteLocator() {
	    return new DiscoveryClientRouteLocator("/", discovery, properties) {
	        @Override
	        protected LinkedHashMap<String, ZuulRoute> locateRoutes() {
	            LinkedHashMap<String, ZuulRoute> routes = super.locateRoutes();
	            
	            routes.values().forEach(r -> r.setStripPrefix(false));
	            
	            return routes;
	        }
	    };
	}
@elnur

This comment has been minimized.

Copy link

elnur commented May 31, 2017

It does have any effect

@spencergibb, this. ^

@ryanjbaxter

This comment has been minimized.

Copy link
Contributor

ryanjbaxter commented May 31, 2017

@elnur its fixed now

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