2017-10-30 3 views
0

私はデジタル海洋でGitlab CIとDjangoを使いたかったのです。私は、液滴を作成し、次の設定でGitlabのインストールを設定した:私は研究室に入るとすべてのURLはGitlabページにリダイレクトされます

external_url = "http:/lab.###.com/" 

# gitlab_rails['gitlab_email_from'] = "[email protected]" 
# gitlab_rails['gitlab_support_email'] = "[email protected]" 

# gitlab_rails['smtp_enable'] = true 
# gitlab_rails['smtp_address'] = "smtp.server" 
# gitlab_rails['smtp_port'] = 465 
# gitlab_rails['smtp_user_name'] = "smtp user" 
# gitlab_rails['smtp_password'] = "smtp password" 
# gitlab_rails['smtp_domain'] = "example.com" 
# gitlab_rails['smtp_authentication'] = "login" 
# gitlab_rails['smtp_enable_starttls_auto'] = true 
# gitlab_rails['smtp_openssl_verify_mode'] = 'peer' 

# nginx['redirect_http_to_https'] = false 
# nginx['ssl_certificate'] = "/etc/gitlab/ssl/gitlab.crt" 
# nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/gitlab.key" 

、ここでは私のnginxの設定

server { 
    listen 80; 
    server_name 150.200.##.## abc.com www.abc.com; 
    client_max_body_size 50M; 

    location = /favicon.ico { access_log off; log_not_found off; } 
    location /static/ { 
     root /home/root/eatplus-django; 
    } 

    location/{ 
     include proxy_params; 
     proxy_pass   http://127.0.0.1:8000/; 
     proxy_redirect  off; 
     # proxy_set_header Host    $host; 
     proxy_set_header X-Real-IP  $remote_addr; 
     proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 
     proxy_connect_timeout 30; 
     proxy_read_timeout 30; 
    } 
} 

で## COMは、私はにリダイレクトしています。 IPアドレスとwww。###。comを入力するときに期待されているGitlabですが、予期せぬ動作であるGitlabページにはまだリダイレクトされています。どのように私はこれを解決するのですか?あなたのnginxの設定で

答えて

0

、そのようにし

server_name lab.###.com; 

にごserver_name設定を変更、nginxのはlab.###.comサブドメインの下にgitlabのページを提供します。

+0

私たちはgitlabとdjangoのために別のURLを持っていますか? – Serenity

+0

はい、できます! Django上流のサーバ設定にすべてのドメインが設定されているか、 'default_server'としてマークされていることを確認してください。 – Oliver

+0

私に例を教えてもらえますか?研究室。###。com for gitlabとwww。###。com .djangoを提供する – Serenity

関連する問題