Skip to content

Commit 6167fb5

Browse files
committed
feat: add proxy-conf samples for forgejo
1 parent 2974133 commit 6167fb5

File tree

2 files changed

+85
-0
lines changed

2 files changed

+85
-0
lines changed

forgejo.subdomain.conf.sample

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
## Version 2024/04/20
2+
# make sure that your forgejo container is named forgejo
3+
# make sure that your dns has a cname set for forgejo
4+
# edit the following parameters in /data/forgejo/conf/app.ini or set as ENV vars in your container
5+
# [server]
6+
# SSH_DOMAIN = forgejo.example.com
7+
# ROOT_URL = https://forgejo.example.com/
8+
# DOMAIN = forgejo.example.com
9+
10+
server {
11+
listen 443 ssl http2;
12+
listen [::]:443 ssl http2;
13+
14+
server_name forgejo.*;
15+
16+
include /config/nginx/ssl.conf;
17+
18+
client_max_body_size 0;
19+
20+
# enable for ldap auth (requires ldap-location.conf in the location block)
21+
#include /config/nginx/ldap-server.conf;
22+
23+
# enable for Authelia (requires authelia-location.conf in the location block)
24+
#include /config/nginx/authelia-server.conf;
25+
26+
# enable for Authentik (requires authentik-location.conf in the location block)
27+
#include /config/nginx/authentik-server.conf;
28+
29+
location / {
30+
# enable the next two lines for http auth
31+
#auth_basic "Restricted";
32+
#auth_basic_user_file /config/nginx/.htpasswd;
33+
34+
# enable for ldap auth (requires ldap-server.conf in the server block)
35+
#include /config/nginx/ldap-location.conf;
36+
37+
# enable for Authelia (requires authelia-server.conf in the server block)
38+
#include /config/nginx/authelia-location.conf;
39+
40+
# enable for Authentik (requires authentik-server.conf in the server block)
41+
#include /config/nginx/authentik-location.conf;
42+
43+
include /config/nginx/proxy.conf;
44+
include /config/nginx/resolver.conf;
45+
set $upstream_app forgejo;
46+
set $upstream_port 3000;
47+
set $upstream_proto http;
48+
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
49+
50+
}
51+
52+
location ~ (/forgejo)?/info/lfs {
53+
include /config/nginx/proxy.conf;
54+
include /config/nginx/resolver.conf;
55+
set $upstream_app forgejo;
56+
set $upstream_port 3000;
57+
set $upstream_proto http;
58+
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
59+
60+
}
61+
}

forgejo.subfolder.conf.sample

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
## Version 2024/04/20
2+
# make sure that your forgejo container is named forgejo
3+
# make sure that forgejo is set to work with the base url /forgejo/
4+
# The following parameters in /data/forgejo/conf/app.ini should be edited to match your setup
5+
# or set as ENV vars in your container
6+
# [server]
7+
# SSH_DOMAIN = example.com:2222
8+
# ROOT_URL = https://example.com/forgejo/
9+
# DOMAIN = example.com
10+
11+
location /forgejo {
12+
return 301 $scheme://$host/forgejo/;
13+
}
14+
15+
location ^~ /forgejo/ {
16+
include /config/nginx/proxy.conf;
17+
include /config/nginx/resolver.conf;
18+
set $upstream_app forgejo;
19+
set $upstream_port 3000;
20+
set $upstream_proto http;
21+
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
22+
23+
rewrite /forgejo(.*) $1 break;
24+
}

0 commit comments

Comments
 (0)