Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue with custom url #13

Open
firebird631 opened this issue Jun 11, 2023 · 5 comments
Open

issue with custom url #13

firebird631 opened this issue Jun 11, 2023 · 5 comments

Comments

@firebird631
Copy link

Hi, thank for this nice theme.

There is issues when gogs is not on root of website, for examples on http://yourhost/gogs/

In that case there is many changes I applied in way to work but I am not satisfied with my solution.

Changing the inject/head.tmpl and prepend the path (in that example prepend with /gogs/ ).
Then there is still issue because it doesn't look at custom/css/themes directory but look for public/css/themes.
So I move the dark_themes.css into public/css/themes/

Finally modify the url( ...) path into the dark_themes.css with prepend /gogs/ in way it retrieve images.

Does someone have a better solutio ?

@Kos-M
Copy link
Owner

Kos-M commented Jun 11, 2023

Hi , thanks i appreciate this.
What issues did you have ?
I have not tested in a sub dir , but i think with standard instructions , if you tweak your server settings you can make it work.
For example you can create a reverse proxy of gogs running in a hidden port with root configuration as is, and forwarding requests from http://yourdomain.com/gogs to internal --> gogs service.

@firebird631
Copy link
Author

In my case it was not able to retrieve the files from custom directory, it necessary needed to move to public. I've really goes on detail, but I found nothing special on Gogs documentation.

@Kos-M
Copy link
Owner

Kos-M commented Jun 15, 2023

I think that happened because web server of yourdomain.com thinks root is yourdomain.com/ but gogs thinks root is
yourdomain.com/gogs/

You need to serve gogs with a reverse proxy , or under a virtual host in apache.
Otherwise probably you will face issues with gogs in general i believe , not just with this theme.

@firebird631
Copy link
Author

firebird631 commented Jun 16, 2023

Thank for your help.

In my case my nginx location :

location /gogs/ {
    proxy_pass                   http://localhost:3000/;
    proxy_set_header        X-Real-IP $remote_addr;
    proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header        Host $http_host;
    proxy_read_timeout      90;
}

and gogs app.ini

ROOT_URL = http://servername/gogs/

@Kos-M
Copy link
Owner

Kos-M commented Nov 13, 2023

try root url without the gogs part. and keep that nginx config the same as above. i have something similar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants