Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Added nginx config example to cut-off ".git" #173

Open
wants to merge 3 commits into
from

Conversation

Projects
None yet
5 participants

It's required to be able to clone with

git clone https://git.example.com/user/project

instead of

git clone https://git.example.com/user/project.git

as it already is on GitHub.

@jvanbaarsen jvanbaarsen commented on the diff Apr 2, 2014

web-server/nginx/gitlab-ssl-limit-cutgit
+ client_max_body_size 256M;
+ proxy_redirect off;
+
+ proxy_read_timeout 300; # https://github.com/gitlabhq/gitlabhq/issues/694
+ proxy_connect_timeout 300; # https://github.com/gitlabhq/gitlabhq/issues/694
+ proxy_redirect off;
+
+ proxy_set_header X-Forwarded-Proto https;
+ proxy_set_header X-Forwarded-Ssl on;
+ }
+}
+
+server {
+ listen *:80 default;
+ location / {
+ rewrite ^ https://git.example.com$request_uri? permanent;
@jvanbaarsen

jvanbaarsen Apr 2, 2014

Can you document somewhere that people have to change this?

@xaionaro

xaionaro Apr 2, 2014

Sorry for my English skills, but I don't understand the question.

Did you mean "why people have to change that"?

@jvanbaarsen

jvanbaarsen Apr 3, 2014

At this point you have hardcoded the url https://git.example.com people may not know that they have to change this.

@xaionaro

xaionaro Apr 3, 2014

I see. Can you show an example of the "documentation"? Should I just add a note in the first lines of this configuration file?

@jvanbaarsen jvanbaarsen commented on the diff Apr 2, 2014

...server/nginx/gitlab-ssl-limit-cutgit-anotherstartpage
+
+server {
+ listen 0.0.0.0:443 ssl;
+ root /home/git/gitlab/public;
+
+ ssl on;
+ ssl_certificate /etc/nginx/gitlab.crt;
+ ssl_certificate_key /etc/nginx/gitlab.key;
+ ssl_protocols SSLv3 TLSv1 TLSv1.2;
+ ssl_ciphers AES:HIGH:!ADH:!MD5;
+ ssl_prefer_server_ciphers on;
+ server_name git.example.com;
+
+ location = /users/sign_in {
+ if ($http_referer ~ "^$") {
+ rewrite ^ https://git.example.com/public/projects redirect;
@jvanbaarsen

jvanbaarsen Apr 2, 2014

Can you document somewhere that people have to change this?

Owner

dosire commented Sep 10, 2015

Should this go into the normal GitLab?

I think having both features (cut of .git and /public as default start page when not logged in) as toggles would be great

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