Repository navigation
Expand file tree
/
Copy pathnginx.conf
More file actions
109 lines (89 loc) · 3.42 KB
/
Copy pathnginx.conf
File metadata and controls
109 lines (89 loc) · 3.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
worker_processes auto;
# default NGINX PID has been moved to /tmp/nginx.pid on unprivileged nginx
pid /tmp/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
# Basic optimizations
sendfile on;
tcp_nopush on;
keepalive_timeout 65;
client_max_body_size 1m;
# Disable server tokens
server_tokens off;
# Server block
server {
listen 80;
server_name _;
absolute_redirect off;
root /usr/share/nginx/html;
# Written at image build time. The production image's file is a comment, so this
# cannot noindex a coolify.io build. Preview images (VITE_SITE_URL host other than
# exactly coolify.io) contain `add_header X-Robots-Tag "noindex, nofollow"`.
include /etc/nginx/conf.d/preview-robots.conf;
# llms-full.txt is a generated corpus that Google was ranking as a page.
# Exact matches beat the static-file regex below. add_header here replaces the server header.
location = /llms-full.txt {
add_header X-Robots-Tag "noindex" always;
try_files /llms-full.txt /docs/llms-full.txt =404;
}
location = /docs/llms-full.txt {
add_header X-Robots-Tag "noindex" always;
try_files /docs/llms-full.txt /llms-full.txt =404;
}
# # Static files handling
# location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
# expires 7d;
# add_header Cache-Control "public, no-transform";
# }
include /etc/nginx/conf.d/redirects.conf;
# Keep missing static assets as real 404s instead of redirecting them to the docs home.
# The generated app emits page files at the web root while public assets are served under /docs.
location ~* ^/docs/(.+\.(?:avif|css|gif|ico|jpe?g|js|json|map|png|svg|ttf|txt|webmanifest|webp|woff2?|xml))$ {
try_files $uri /$1 =404;
}
location ~* \.(?:avif|css|gif|ico|jpe?g|js|json|map|png|svg|ttf|txt|webmanifest|webp|woff2?|xml)$ {
try_files $uri =404;
}
location = /docs {
try_files /docs/index.html /index.html @docs_not_found;
}
location = /docs/ {
try_files /docs/index.html /index.html @docs_not_found;
}
location ~ ^/docs/(.+)$ {
index index.html;
try_files $uri/index.html $uri.html $uri /$1/index.html /$1.html /$1 @docs_not_found;
}
location / {
index index.html;
# # Add rewrite rule to handle URLs without trailing slash
# rewrite ^([^.]*[^/])$ $1/ permanent;
try_files $uri/index.html $uri.html $uri @docs_not_found;
}
location @docs_not_found {
return 404;
}
error_page 404 /docs/404.html;
# A folder without index.html raises 403; treat it as a missing page.
error_page 403 =404 /docs/404.html;
location = /docs/404.html {
internal;
try_files /docs/404.html /404.html =404;
}
location = /favicon.ico {
rewrite ^/favicon.ico$ /docs/brand/favicon.ico;
access_log off;
log_not_found off;
}
# Deny access to hidden files
location ~ /\. {
deny all;
access_log off;
log_not_found off;
}
}
}