-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathnginx.conf
More file actions
41 lines (33 loc) · 1.22 KB
/
nginx.conf
File metadata and controls
41 lines (33 loc) · 1.22 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
server {
# Listen on port 8080
listen 8080;
# Define the server name (your baseURL or domain)
server_name docs.aurora.cloud-nuage.canada.ca;
# Disable absolute redirects
absolute_redirect off;
# Root directory and index for the static Hugo site
root /usr/share/nginx/html;
index index.html;
set_real_ip_from 0.0.0.0/0;
real_ip_header X-Forwarded-For;
real_ip_recursive on;
# Location block for serving requests
location / {
# Serve the files, fallback to 404 if not found
try_files $uri $uri/ =404;
# Pass X-Forwarded-* headers (important if behind a reverse proxy)
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
# Block access to hidden/sensitive files like .git and .htaccess
location ~ /\. {
deny all;
access_log off;
log_not_found off;
}
# Enable gzip compression for better performance
gzip on;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
}