-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
62 lines (49 loc) · 1.55 KB
/
nginx.conf
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
# NGINX Compatible conf (no cgi or upload)
server {
listen 8080;
server_name example.co example.fr;
# Default error pages
# error_page 403 /errors/403.html;
# error_page 500 /errors/500.html;
error_page 404 /errors/404_main.html;
# Client body size limit (in bytes)
client_max_body_size 1048576; # 1MB
root /var/www/html/test_site; # Root directory for the server
autoindex on;
index i-index.html;
# Routes configuration
location / {
autoindex on;
index i-index.html; # Default file if request is a directory
limit_except GET POST { deny all; } # Allowed HTTP methods
client_max_body_size 123;
}
location /dir/ {
error_page 404 /errors/404_api.html;
limit_except GET POST { deny all; } # Allowed HTTP methods
}
location /site/ {
limit_except GET POST { deny all; } # Allowed HTTP methods
}
location /redirect/ {
return 301 http://anotherdomain.com;
return 200 blabla; # Should be ignored
limit_except GET { deny all; } # Allowed HTTP methods
}
}
# Additional server instance (example of multiple server configurations)
server {
listen 8081;
server_name another.local;
# Default error pages
error_page 404 /errors/404.html;
error_page 500 /errors/500.html;
# Client body size limit (in bytes)
client_max_body_size 2048000; # 2MB
location /files/ {
root /var/www/files;
index index.html;
limit_except GET POST { deny all; }
autoindex off;
}
}