Installing Gogs on my Nginx Powered RPI3


#1

Hi guys!

So I have currently set up some kind of personal web server on my RPI3 running on the latest Raspbian Stretch OS using the Nginx, MySQL and PHP stack.

The project that I’m trying to build is so that I can have a personal dashboard of some sort to maintain code and host side projects on by connecting to http://[mydomain].com and logging in being prompted to my personal set of tools.

So I have the whole stack configured and even got to the point where my server was accessible outside my local network through a domain name I bought.

So the next step that I’m currently stuck at (and also driving me superbly insane) is trying to install a git service like Gogs.

I’m just really stuck because all of the tutorials on installing Gogs revolve around being able to access Gogs after the install through http://localhost or http://localhost:3000 but my RPI3 isn’t configured that way. It’s accessible through my IP address which then shows the index.php I have on my Nginx /var/www/html folder.

So I really don’t know how to install Gogs this way and ideally I would like to be able to access it through http://[mydomain].com/gogs

Can anyone point me to the right direction to do this?


#2

Change this config option to whatever the URL is. Then, for the NGINX part, read https://gogs.io/docs/intro/faqs#how-do-i-set-up-a-sub-path-with-nginx%3F.

Of course, you need other things that need to be configured, I just pointed out one main config option for you.


#3

Thanks! So I managed to get it installed and running on http://[myip]:3000 and tried following the instructions you’ve given me and while it has become accessible on http://[myip]/git/, I’m welcomed with this display. Was there something I did wrong?

At first I followed everything to a T on the second link you’ve given me and I got this page in a mess with the page title called “Page Not Found.”

And then after Googling around, I found these instructions so I did create a virtual host called gogs on /etc/nginx/sites-available directory and filled it with the proxy pass code and created a symlink towards the /etc/nginx/sites-enabled directory and then it somehow looked better…? But yeah, still a mess like this. Thanks by the way! At least I have it installed now. Just the challenge of configuring it properly to nginx now.


#4

I think your ROOT_URL isn’t configured correctly, post it here.


#5

I think you’re right. I had my ROOT_URL simply as http://[myip]/git, I added a slash after and it’s appearing properly now. Thanks!