Gogs on subdomain like git.mydomain.com

Hello

How can i put gogs on subdomain
here is /etc/httpd/conf.d.gogs.conf

VirtualHost *:80>
ServerName git.mydomain.com

<Location "/">
    ProxyPreserveHost On
    ProxyPass http://localhost:3000/
    ProxyPassReverse http://localhost:3000/
</Location>

app.ini is like this:

[server]
DOMAIN = 127.0.0.1
HTTP_PORT = 3000
EXTERNAL_URL = http://git.mydomain.com/
DISABLE_SSH = false
SSH_PORT = 22
START_SSH_SERVER = false
OFFLINE_MODE = false

Maybe this will off use as reference for you?

i couldn’t use your code and understand it. Please provide me a formatted and executable code

I’m out of luck. If you can’t the example already provided. I am down to just pointing you to other published guides on the internet. Otherwise. Please provided technical details concerning the error you experience when trying to configure Gogs on a subdomain.

Thanks for your response, I’m running centos 7 server and as i already mentioned i want to users access gogs via subdomain not port 3000. I’ve spent much time searching and googling but not any luck.

Looks like you’re using Apache 2? https://gogs.io/docs/intro/faqs#how-do-i-set-up-a-sub-url-with-apache-2%3F