home-server/roles/dmz_nginx/templates/10.conf.j2

63 lines
2.4 KiB
Plaintext
Raw Normal View History

2018-09-03 20:06:05 +02:00
# The home-server project produces a multi-purpose setup using Ansible.
2023-07-30 19:31:56 +02:00
# Copyright © 20182023 Y. Gablin, under the GPL-3.0-or-later license.
2018-09-03 20:06:05 +02:00
# Full licensing information in the LICENSE file, or gnu.org/licences/gpl-3.0.txt if the file is missing.
2023-12-30 16:32:52 +01:00
client_body_temp_path /var/tmp/client_body_temp;
proxy_temp_path /var/tmp/proxy_temp;
fastcgi_temp_path /var/tmp/fastcgi_temp;
uwsgi_temp_path /var/tmp/uwsgi_temp;
#scgi_temp_path /var/tmp/scgi_temp;
2018-09-03 20:06:05 +02:00
client_max_body_size {{http_max_upload}};
gzip on;
gzip_comp_level 6;
gzip_proxied any;
gzip_types application/atom+xml application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/javascript text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy text/xml;
index index.php index.html;
log_format proxy_log '$proxy_protocol_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent"';
reset_timedout_connection on;
server_tokens off;
root {{http_root}};
# server for regular HTTP contents
server {
listen unix:/run/shared_sockets/http.pp proxy_protocol;
access_log /var/log/nginx/http_access.log proxy_log;
set_real_ip_from unix:;
real_ip_header proxy_protocol;
2021-05-06 16:10:20 +02:00
set $proxy_scheme "http";
2018-09-03 20:06:05 +02:00
set $proxy_https "off";
set $proxy_port "80";
include inc.d/{{nickname}}_php-full.inc;
include inc.d/{{nickname}}_filters.inc;
include inc.d/*.http.inc;
}
# server for regular HTTPS contents
server {
listen unix:/run/shared_sockets/https.pp proxy_protocol;
access_log /var/log/nginx/https_access.log proxy_log;
set_real_ip_from unix:;
real_ip_header proxy_protocol;
2021-05-06 16:10:20 +02:00
set $proxy_scheme "https";
2018-09-03 20:06:05 +02:00
set $proxy_https "on";
set $proxy_port "443";
include inc.d/{{nickname}}_php-full.inc;
include inc.d/{{nickname}}_filters.inc;
include inc.d/*.http.inc;
include inc.d/*.https.inc;
}
# server for privileged HTTPS contents
server {
listen unix:/run/shared_sockets/https+.pp proxy_protocol;
access_log /var/log/nginx/https_access.log proxy_log;
set_real_ip_from unix:;
real_ip_header proxy_protocol;
2021-05-06 16:10:20 +02:00
set $proxy_scheme "https";
2018-09-03 20:06:05 +02:00
set $proxy_https "on";
set $proxy_port "443";
include inc.d/{{nickname}}_php-full.inc;
include inc.d/*.http.inc;
include inc.d/*.https.inc;
}