aboutsummaryrefslogtreecommitdiff
path: root/infra/containers/cgit/nginx.conf
diff options
context:
space:
mode:
Diffstat (limited to 'infra/containers/cgit/nginx.conf')
-rw-r--r--infra/containers/cgit/nginx.conf46
1 files changed, 46 insertions, 0 deletions
diff --git a/infra/containers/cgit/nginx.conf b/infra/containers/cgit/nginx.conf
new file mode 100644
index 0000000..df50345
--- /dev/null
+++ b/infra/containers/cgit/nginx.conf
@@ -0,0 +1,46 @@
+# Copyright (C) 2026 Doan Luu Duc Tai <doan@luuduct.ai>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+user www-data;
+worker_processes auto;
+pid /run/nginx.pid;
+error_log /dev/stderr warn;
+events { worker_connections 1024; }
+http {
+ include /etc/nginx/mime.types;
+ default_type application/octet-stream;
+ access_log /dev/stdout;
+ map $http_x_forwarded_proto $cgi_https {
+ default "";
+ https on;
+ }
+ server {
+ listen 8080;
+ server_name _;
+ root /usr/share/cgit;
+ location ~* ^/(cgit\.(css|png|js)|favicon\.ico|robots\.txt)$ {
+ expires 30d;
+ }
+ location / {
+ include /etc/nginx/fastcgi_params;
+ fastcgi_param SCRIPT_FILENAME /usr/lib/cgit/cgit.cgi;
+ fastcgi_param PATH_INFO $uri;
+ fastcgi_param QUERY_STRING $args;
+ fastcgi_param HTTP_HOST $http_host;
+ fastcgi_param HTTPS $cgi_https;
+ fastcgi_pass unix:/run/fcgiwrap/socket;
+ }
+ }
+}