upstream gitlab-workhorse { server 172.18.147.173:8181; #根据实际情况修改
}
## Normal HTTP host
server {
listen 80;
listen [::]:80 default_server;
server_name gitlab.papamk.com; ## 修改成自己的域名;
server_tokens off; ## Don't show the nginx version number, a security best practice
root /opt/gitlab/embedded/service/gitlab-rails/public;
## See app/controllers/application_controller.rb for headers set
## Individual nginx logs for this GitLab vhost
access_log /home/wwwlogs/gitlab_access.log; # 根据实际情况修改
error_log /home/wwwlogs/gitlab_error.log; # 根据实际情况修改
location / {
client_max_body_size 0;
gzip off;
## https://github.com/gitlabhq/gitlabhq/issues/694
## Some requests take more than 30 seconds.
proxy_read_timeout 300;
proxy_connect_timeout 300;
proxy_redirect off;
upstream gitlab-workhorse { server 172.18.147.173:8181; #根据实际情况修改
}
## Redirects all HTTP traffic to the HTTPS host
server {
## Either remove "default_server" from the listen line below,
## or delete the /etc/nginx/sites-enabled/default file. This will cause gitlab
## to be served if you visit any address that your server responds to, eg.
## the ip address of the server (http://x.x.x.x/)
listen 0.0.0.0:80;
listen [::]:80 ipv6only=on default_server;
server_name gitlab.papamk.com; ## 改成自己的域名
server_tokens off; ## Don't show the nginx version number, a security best practice
return 301 https://$http_host$request_uri;
access_log /home/wwwlogs/gitlab_access.log; # 根据实际情况修改
error_log /home/wwwlogs/gitlab_error.log; # 根据实际情况修改
}
## HTTPS host
server {
listen 0.0.0.0:443 ssl;
listen [::]:443 ipv6only=on ssl default_server;
server_name gitlab.papamk.com; ## 改成自己的域名
server_tokens off; ## Don't show the nginx version number, a security best practice
root /opt/gitlab/embedded/service/gitlab-rails/public;
## https://github.com/gitlabhq/gitlabhq/issues/694
## Some requests take more than 30 seconds.
proxy_read_timeout 300;
proxy_connect_timeout 300;
proxy_redirect off;