-
Notifications
You must be signed in to change notification settings - Fork 197
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
ability to override default location block to support single-page-applications #58
Comments
@srang I can see empty |
I was gonna put up a PR with an update to assemble that looks for a file called ‘nginx-default-loc.conf’ and if found, sed’s the default location block with an include for that new file |
To be honest I'm not sure what you want to do - from PR it'll be more clear I think. So guessing: following can't be used? ./nginx-default-cfg/*.conf |
The issue I ran into when trying to serve an SPA using ‘nginx-default-cfg/‘ was that when I needed to serve the app from root it conflicted with the existing location block. I’ll get up the PR and we can review and figure out if it makes sense (I can also throw together a gist example of what I’m trying to allow for) |
Hey sorry it took me so long to get something together. I still have a couple kinks to work out but here is an example of what I'm looking to do.
This is working for serving the app, but my proxy and spa configs aren't working well together right now. Let me know if this (the flag in the assemble script) is something that is a good fit or should not be included in the upstream. |
Thanks. I hope I finally understand. Sorry. It makes sense, but I'm not nginx expert. @notroj What do you think? |
/cc @atamanroman Any updates here? We are hitting this bug. We want to use this image not for S2I builds just for plain docker build.
is not good enough since we need to use our own
Nginx does not allow to define a location twice and I don't see the reason why there is a empty |
@jkroepke in the short term you might be able to pull out the
I did have some permission problems with running the inplace ( |
@srang Yeah Thank for the snippet. We steal the code already from here ;-) https://github.com/srang/angular-5-example/blob/rhel/nginx/.s2i/bin/assemble#L10 But this shouldn't be the workaround in 2018. |
Yes please! I've run into the same issue while deploying single-page apps. My current solution to avoiding conflicting
But then I'm wedded to It would be great if I didn't have to inherit so many custom configurations when all I really want is Thanks! ❤️ |
This is the generated nginx.conf from my running container, https://gist.github.com/lholmquist/d9c3138b1253f4f6ef72e6eaef2f9a5b I just modified this where i needed to, then supplied it to the image, so it would use this one. a bit of a hack, but i think it gets around the issue for now |
Hi I think that to solve this issue the best way could be adding the following: |
I JUST hit this same issue and it's still open from 2 years ago. @jkroepke Any updates? |
Yes. I use the sed from here (#58 (comment)) in my downstream images. |
Right now the nginx.conf provided by s2i by default includes a block:
in the
default_server
block. When serving an SPA at root this causes problems. There are a bunch of examples out there for how to serve single page apps from rootWhat I'd like to propose (and will submit a PR for) is to allow an environment flag for replacing the default location block with SPA block.
Or if we want to add the ability to inject a SPA block through a predefined named file.
The text was updated successfully, but these errors were encountered: