Files
nginx-snippets/hostfiles/gitea-multi.80.conf
2025-12-19 15:48:34 +01:00

67 lines
2.7 KiB
Plaintext

##### Process http start #######################################################
server {
listen 80;
server_name DOMAIN;
server_tokens off;
##### Optional include custom Error pages start ############################
include /etc/nginx/nginx-snippets/custom-errors.conf;
##### Optional include custom Error pages stop #############################
##### Optional disable gzip start ##########################################
# gzip off;
##### Optional disable gzip stop ###########################################
##### Optional disable access log start ####################################
# access_log off;
##### Optional disable access log stop #####################################
##### Block Bad referers and bad bots start ################################
if ($bad_referer) { return 444; }
if ($bad_user_agent) { return 444; }
##### Block Bad referers and bad bots stop #################################
##### Optional stuff start #################################################
# include /etc/nginx/nginx-snippets/block-engines.conf;
# include /etc/nginx/nginx-snippets/log-exclude.conf;
location = /.env { access_log off; log_not_found off; }
location = /favicon.ico { access_log off; log_not_found off; }
include /etc/nginx/nginx-snippets/block-htaccess.conf;
include /etc/nginx/nginx-snippets/gitea-block-files.conf;
##### Optional stuff stop ##################################################
##### Enable fastcgi cache start ###########################################
set $skip_cache 0;
##### Enable fastcgi cache stop ############################################
##### Process content start ################################################
#
# Gitea robots.txt + sitemap.xml
#
location = /robots.txt {
root /var/lib/GITEAUSER/custom/public;
try_files /robots.txt =404;
}
location = /sitemap.xml {
root /var/lib/GITEAUSER/custom/public;
try_files /sitemap.xml =404;
}
#
# Gitea execuatable
#
location / {
proxy_pass http://127.0.0.1:GITEAPORT;
include /etc/nginx/nginx-snippets/gitea-proxy-headers.conf;
}
##### Process content stop #################################################
##### Cache js css static content and open files start #####################
# include /etc/nginx/nginx-snippets/cache-open-files.conf;
# include /etc/nginx/nginx-snippets/cache-statics.conf;
# include /etc/nginx/nginx-snippets/cache-js-css.conf;
##### Cache js css static content and open files stop ######################
}
##### Process http stop ########################################################