Have you tried Redirect instead of Rewrite? Redirect permanent / https://<server address>
Em segunda-feira, 10 de junho de 2013 18h34min44s UTC-3, David Reagan escreveu: > > That's pretty much what I have in my set up. And if I use https in the > address bar, it works just fine. > > Unfortunately, if I add a rewrite rule like: rewrite ^ > https://$server_name$request_uri? permanent; > > Running git clone fails. > > With the rewrite: > >> git clone [email protected]:gitdeploy.git >> Cloning into 'gitdeploy'... >> fatal: The remote end hung up unexpectedly > > > Without: > >> git clone [email protected]:gitdeploy.git >> Cloning into 'gitdeploy'... >> remote: Counting objects: 57, done. >> remote: Compressing objects: 100% (54/54), done. >> remote: Total 57 (delta 24), reused 0 (delta 0) >> Receiving objects: 100% (57/57), 6.52 KiB, done. >> Resolving deltas: 100% (24/24), done. > > > Thoughts? > > I'm confused why a clone over SSH would care if I'm rewriting to https.... > > On Monday, May 20, 2013 6:37:06 PM UTC-7, Michael Smith wrote: >> >> My current setup is working with https, and automatically redirects all >> http requests to https. Here are the relevant parts of the config files: >> >> *In /home/git/gitlab/config/gitlab.yml:* >> ## GitLab settings >> gitlab: >> ## Web server settings >> host: androidgithost.com >> port: 443 >> https: true >> # Uncomment and customize to run in non-root path >> # Note that ENV['RAILS_RELATIVE_URL_ROOT'] in config/unicorn.rb may >> need to be changed >> # relative_url_root: /gitlab >> >> *In /etc/nginx/sites-enabled/gitlab:* >> server { >> listen 80 default; >> server_name androidgithost.com; >> rewrite ^ https://$server_name$request_uri? permanent; >> } >> >> >> server { >> listen 443 default ssl; # e.g., listen 192.168.1.1:80; In most >> cases *:80 is a good idea >> server_name androidgithost.com; # e.g., server_name >> source.example.com; >> root /home/git/gitlab/public; >> ssl_certificate androidgithost.com.crt; >> ssl_certificate_key androidgithost.com.key; >> ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2; >> ssl_ciphers HIGH:!aNULL:!MD5; >> >> -- You received this message because you are subscribed to the Google Groups "GitLab" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
