Closed (fixed)
Project:
Barracuda
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
31 Oct 2011 at 14:18 UTC
Updated:
19 Dec 2011 at 09:10 UTC
Jump to comment: Most recent file
After installing the global.override.inc and configuring the secure_page like section, I am getting the following error
SSL Proxying not enabled for this host: enable in Proxy Settings, SSL locations
Secure_Pages was installed but it was removed.
Any ideas?
Thanks
Todd
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | override.global.inc_.txt | 2.27 KB | toddgeist |
| #2 | barracuda_log.txt | 494 bytes | toddgeist |
| #2 | install.log_.txt | 5.83 KB | toddgeist |
Comments
Comment #1
omega8cc commentedThis is not enough information. Please follow bug submission guidelines: http://drupal.org/node/add/project-issue/barracuda
Comment #2
toddgeist commentedHere is the requested info
Hosting Provider: Rackspace
Server OS: Ubuntu 11.04 (Natty Narwhal)
RAM: 2048 mb.
I ran the barracuda and octopus installers again 4 days ago.
The platform I am using was Drupal 7.8, but I upgraded it yesterday to 7.9 using Drush up. I did NOT create a new 7.9 platform and migrate the site.
The two requested files are attached
Thanks
Todd
Comment #3
omega8cc commentedThanks.
Note that you should *never* upgrade Drupal core with Drush!
You can use BOA head which includes D 7.9 already.
Also, where do you see this error? Some screenshot would help probably.
Comment #4
toddgeist commented"SSL Proxying not enabled for this host"
was coming from Charles. I Didn't set up ssl proxying on Charles correctly
Sorry :-(
Safari reports this error as "too many redirects". And now that I have Charles setup correctly, I can see that it is redirecting to the same link 16 times and then dies. Always with "HTTP/1.1 301 Moved Permanently"
Comment #5
toddgeist commentedThanks
Should I run BOA head, and then migrate the site to the 7.9?
Todd
Comment #6
omega8cc commentedCharles?
Sorry, we can't help if you don't provide enough information about your environment and system/network configuration.
Comment #7
omega8cc commentedPlease provide exact steps to reproduce the issue, with URLs to test etc.
Make sure you don't have internal Aegir SSL feature enabled and there is no module causing unexpected redirects.
Comment #8
toddgeist commentedCharles is web request debugging tool.
http://www.charlesproxy.com/
I was using to see if I could get any more information about what was going on. I did not have it configure to handle SSL. That is where the error that I orientally posted was coming from.
But Charles is not the issue. I am still getting too many redirects.
I am also including the goblal.override.inc file. In case that is of interest.
Thanks
Comment #9
omega8cc commentedCould you disable this Charles proxy and simply access the site directly?
Also, please provide steps to reproduce the issue, as I requested above.
Comment #10
omega8cc commentedI'm sure you have some module or setting in your site which causes the extra redirects (loop). It is *not* BOA issue.
Comment #11
toddgeist commentedI set the global override to match blog posts so any blog post should throw the error. Here is a link
http://www.geistinteractive.com/blog/2011/09/gosign20-preview
Comment #12
omega8cc commentedThis redirect to HTTPS is not caused by the proper extra settings in the
global.override.incfile. What you did there doesn't make any sense, sorry. You should use the original configuration we provide in this file. Otherwise you are making your debugging impossible.Could you please check *and disable* any other redirects you configured in your site?
I believe we can close this issue, because it is unrelated to BOA, rather to some wrong configuration in your site.
Feel free to re-open when you will find anything new after some real debugging, as suggested above.
Comment #13
omega8cc commentedI don't see here your comment I received via e-mail, so I'm posting it here:
"I must have missed the part when BOA stopped using the Aegir feature. I
have just now set the site to have encryption disabled. So I assume
that now there is a different way to enable ssl."
Have you read what I wrote in the #7 comment above? - "Make sure you don't have internal Aegir SSL feature enabled "
BOA *never* used Aegir built-in SSL feature. It is explained in the docs: http://drupalcode.org/project/barracuda.git/blob/HEAD:/docs/SSL.txt
Comment #14
toddgeist commentedSo I can tell that the HTTP_X_FORWARDED_PROTO header is not getting set. This is what is causing the loop.
Is that handled in the SSL setup or is it else where?
Thanks for the instructions on setting up SSL but that is for multiple IP addresses. Are there instructions for when you only have one IPAddresses
Thanks
Todd
Comment #15
omega8cc commentedNo, properly used docs/examples will not cause any loops, as it will set the header correctly.
For single-IP server please read: http://groups.drupal.org/node/183789#comment-608709
Comment #16
toddgeist commentedOk, I got it fixed!
I can't say exactly what got the Redirects to stop looping. That HTTP_X_FORWARDED_PROTO header stated getting set correctly. I am afraid I don't know what started it working.
I disabled the Aegir SSL, and followed the instructions for getting SSL setup with a single IP address by replacing the SSL cry and key files created by nginx ( or barracuda ) with my own.
The redirects stopped failing before I got the SSL certs installed correctly, so I don't think that fixed it. The only other thing I did was use global.override.inc to Disable Memcached + Redis cache for listed domains. and Disable Memcached + Redis cache for anonymous visitors as well. I know that this is a performance hit, but I am ohm with it for now. I will turn that back on later and see if that was part of the problem.
Thanks
Todd
Comment #17
omega8cc commentedIt was probably enough to restart Redis/Memcached, not disable it. It is restarted every 30 minutes but you can also restart it manually:
bash /var/xdrago/clear.shComment #18
toddgeist commentedah thanks for that.
Could bad cache have been messing with my the redirects?
Thanks
Comment #19
omega8cc commentedProbably, as it may still store your settings if you didn't use the clear cache button in Drupal etc.
Comment #21
thedavidmeister commentedpretty sure i'm having the same (or a very similar) problem.
i get the too many redirects issue until i visit /user, after which point the problem goes away until i clear my browser case. Then it breaks again.
subscribing.
Comment #22
thedavidmeister commentedfor reference the discussion starts here: http://groups.drupal.org/node/187029
hey, is there any way that we can do this through an nginx config pushing everything from http to https? i'm getting no luck at all doing this via php, and it does seem to be because HTTP_X_FORWARDED_PROTO isn't always coming through.
Comment #23
omega8cc commented@thedavidmeister - It is better to do that on the PHP level, and it gives you much more flexibility, it does work when done properly and when you don't use any stuff like Secure Pages module to introduce conflicts.
On the Nginx level it can be tricky (or even not possible). For example, you can't make it domain-specific with config like below, because Nginx doesn't support nested
if():You would need to use extra location to separate the
if()directives, but this will not work when SSL proxy (BOA standard) is used, as$schemeis alwayshttpin the server behind the SSL proxy and it will cause redirects loop:As you can see, it is much simpler and more flexible on the PHP level.
Comment #24
omega8cc commentedNote - you could still enable Aegir native SSL support and then it will manage this redirect for you on the Nginx level (there is a "forced SSL" option), however then you will need to manually replace the SSL cert and key created by Aegir with your real cert and key. Plus, you will hit Aegir own limitations related to IP addresses management.
Comment #25
thedavidmeister commentedThanks for the reply!
I have already replaced the cert and key with my own, as per the instructions posted elsewhere for wildcard certs.
basically, the problem is that I copied the exact example here:
http://drupalcode.org/project/barracuda.git/blob/HEAD:/aegir/conf/overri...
and replaced "domain.com" with the domain I'm using. Nothing else. Tried just using the bottom bit, tried using the whole thing.
Turned of Secure Pages. Turned off SSL management in Aegir. Cleared cache from within Drupal UI (not just through Drush).
the redirect does indeed work just fine but *only* when you've viewed the user page or logged in. Even if you log out again this will still work.
However, if you logout and clear your browser cache, or if you're a first time visitor, you'll get an infinite redirect loop.
turning OFF the redirect and trying
print_r( $_SERVER );just to see what is going on revealed that the HTTP_X_FORWARDED_PROTO is not set in the "preauthenticated" state for a user (and neither is $_SERVER['https'] btw), even when you view a page with https protocol. This obviously messes with the "if" statement since it will redirect to https constantly if that variable is not being set by NGINX before PHP starts playing around with it.I have no idea why the header wouldn't be set, and beyond what I've described I don't know what else I could do to make sure the config is "done properly".
Incidentally, setting a redirect in NGINX to https worked fine, but (I think) because this didn't help those headers being set, Drupal generates pages with a bunch of http links in it, so I get security warnings for mixed protocol media all through my site. The redirect through NGINX was kind of a hollow victory in this case :(
Any ideas for things I could try to debug the issues re: sending the header info properly?
Comment #26
omega8cc commentedThis is because
HTTP_X_FORWARDED_PROTOis sent from the HTTPS proxy to the Nginx and PHP-FMP backend, while$_SERVER['HTTPS'] = 'on';is set on the PHP-FPM level, to satisfy Drupal, if the request comes withHTTP_X_FORWARDED_PROTOheader set tohttps. Note thatHTTP_X_FORWARDED_PROTOheader is sent to the backend only, and not to you with the response proxied from the backend to your browser.When you are trying redirect on the Nginx level, you can't use any other redirects in Drupal or
override.global.incfile. You should also disable, uninstall and remove any modules like Secure Pages - it is not enough to disable them.Basically, don't try all these things at once. Don't use Secure Pages (uninstall and remove it) and use only our snippet in
override.global.incwhere you can easily manage which URLs should be forced as HTTPS and which as HTTP etc. It really works great and gives you full control without messing up your Nginx config. Just avoid redundant stuff lying around for redirects.Comment #27
thedavidmeister commentedwhen you say "can't use any other redirects" do you mean literally all redirects?
what if i want to use the Global Redirect module, or I want to use a drupal_goto to send somebody to the latest posted node of a certain type from a menu link?
I do have some non-ssl related redirects in place and they're kind of important for the way I want the site to work and it would be quite time consuming to identify and remove all of them as a few different developers have worked on this project. Do I have to disable all of these as well?
Comment #28
thedavidmeister commentedAlso, do i have to uninstall and remove the SSL modules in Aegir, or is it enough to just disable those?
Comment #29
thedavidmeister commenteduninstalling secure_pages instead of just disabling it seemed to do the trick, but I'm still a bit confused as to how all the caching stuff works. I thought I was across it but this issue leads me to believe that I'm not fully...
I might open some separate support issues later, but for now I'm happy that this has been resolved.
Comment #30
omega8cc commentedI was referring to SSL redirects, not all kinds of redirects, obviously, and no, you don't need to remove anything from Aegir, you have to do that for your site only, to avoid conflicts.