Hi,
i’m pretty new in server infrastructure and i have recently installed on a vps Gitlab with the Omnibus package on Ubuntu server 14.04.
Installation was fine and i can now access my Gitlab at my_vps.com/
But i also would like my Nginx server to manage my ruby projects and i don’t know how to do it…
I read about Nginx and its own embeded server so i edit the /etc/gitlab/gitlab.rb like this :
unicorn['enable'] = false
web_server['external_users'] = ['www-data']
nginx['enable'] = false
ci_nginx['enable'] = false
and after sudo gitlab-ctl reconfigure
I also configured my nginx.conf like this :
user www-data;
worker_processes 4;
pid /run/nginx.pid;
events {
worker_connections 768;
}
http {
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
ssl_prefer_server_ciphers on;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
gzip on;
gzip_disable "msie6";
passenger_root /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini;
passenger_ruby /usr/bin/passenger_free_ruby;
# test app conf
server {
listen 80 default_server;
listen [::]:80 default_server;
passenger_enabled on;
passenger_ruby /home/dev/.rvm/gems/ruby-1.9.3-p551/wrappers/ruby;
root /var/www/test_rails_app/public;
index index.html index.htm index.nginx-debian.html;
server_name my_vps.com;
location /test-app {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
}
server {
listen *:80;
server_name my_vps.com;
server_tokens off;
root /opt/gitlab/embedded/service/gitlab-rails/public;
client_max_body_size 250m;
access_log /var/log/gitlab/nginx/gitlab_access.log;
error_log /var/log/gitlab/nginx/gitlab_error.log;
# Ensure Passenger uses the bundled Ruby version
passenger_ruby /opt/gitlab/embedded/bin/ruby;
# Correct the $PATH variable to included packaged executables
passenger_env_var PATH "/opt/gitlab/bin:/opt/gitlab/embedded/bin:/usr/local/bin:/usr/bin:/bin";
# Make sure Passenger runs as the correct user and group to
# prevent permission issues
passenger_user git;
passenger_group git;
# Enable Passenger & keep at least one instance running at all times
passenger_enabled on;
passenger_min_instances 1;
error_page 502 /502.html;
location /gitlab {
try_files $uri $uri/index.html $uri.html @gitlab;
}
}
I can access Gitlab at my_vps.com/ but not my ruby app at my_vps.com/test-app
Can I have some help please ?