Change Nginx port number

Hi,

Firstly, I’m sorry, but my English is not perfect. I’d like to run my web server (NodeJS) on the same server where my GitLab is running. I changed in gitlab.rb the external_url from mydomain.com to mydomain.com:8000. Reconfigured and restarted Gitlab. It works fine, I can reach gitlab on mydomain.com:8000, but port 80 is already in use. I’ve tried to uncomment and change nginx[‘listen_port’] = 80 to 8000, but it’s not working. Port 80 is already in use.

Can somebody help me to solve this problem? :slight_smile:

Thank you,

The first step is to add another DNS entry that points to the external IP address of your server, eg gitlab.mydomain.com.

Then add this to your nginx config:

server {
server_name gitlab.mydomain.com

access_log /var/log/nginx/gitlab.access_log main;
error_log /var/log/nginx/gitlab.error_log info;

location /$ {
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://127.0.0.1:8000/;
}
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://127.0.0.1:8000/;
}
}