-
-
Notifications
You must be signed in to change notification settings - Fork 881
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
A redirect-only vhost #370
Comments
@xaque208 You're spot on. Right now, the rewrite rules are only in the location block. PR's most certainly accepted. |
I'm interested in this - from what I can see it's not possible. Can anyone confirm that? I'm going to keep looking, and maybe submit a PR this week |
I think It's possible to have a setup like that with today features but maybe sure it's not friendly, something like this should do the trick:
|
Thanks, works for me 👍 . |
I think this rewrite solutions are bad at all. why not providing a nginx::ressource::vhost with a scheme 301 redirect?
or:
instead of:
|
I also want something like @khaefeli is suggesting. Any updates on providing this? |
I have done this unfortunately, I am not at work but hope to remember to
|
@joshuagordondba it's Monday today, even though a few month later ;) , so I wanted to send a little reminder as I am very interested in your solution! |
What do you think of #774 ? |
Sorry for the lack of discussion / merge for this. I will comment in #774 |
It would be nice to have the way to do a return and suppress the rest of the configs in the vhost, similar to what we do with the SSL rewrite or when |
Hello, |
I think this should be closed. nginx::resource::server { 'somewhere.old':
maintenance => true,
maintenance_value => 'return 301 $scheme://somewhere.new$request_uri',
} |
Thanks! |
We're in the process of evaluating this module instead of our own for various reasons, but I am having trouble reproducing a config that we use pretty commonly. I'm willing to add support if it turns out thats required, but I thought I'd ask if there was a clean way to do this with the module in its current form.
First, here is the resulting vhost I am trying to produce.
So here there are no locations, no other resources, just receive requests on
sitea.example.com
and redirect them tositeb.example.com
. Pretty simple.Now the manifest I tried to work out to do this.
I'm willing to suspend my annoyance at the lack of brevity required here, but this doesn't do what I need, since the
rewrite_rules[]
only exists within thelocation
blocks. Nginx supports the ability to have rewrite rules in the server blocks, so it seems to me that the module should also support this.Is there a way that those more experienced with this module can think of to produce the desired state with what exists today? If so, how? If not, what would be the best approach I could take to add support?
I was thinking some kind of
rewrite_only
fornginx::resource::vhost
, but from what I can tell that class seems to revolve around a location based server resource block.Any insight would be appreciated.
Cheers.
The text was updated successfully, but these errors were encountered: