19
19
'"$http_user_agent " "$http_x_forwarded_for "' ;
20
20
21
21
access_log /var/log/nginx/access.log main ;
22
+ error_log /var/log/nginx/error.log;
22
23
23
24
sendfile on ;
24
25
#tcp_nopush on;
@@ -31,11 +32,9 @@ http {
31
32
server {
32
33
listen 80 ;
33
34
index index.html index.htm;
34
- root /usr/share/nginx/html ;
35
+ root /mnt/volumes/statics/ ;
35
36
36
37
location / {
37
- proxy_pass http://django:8000;
38
-
39
38
if ($request_method = OPTIONS) {
40
39
add_header Access-Control-Allow-Methods "GET, POST, PUT, PATCH, OPTIONS" ;
41
40
add_header Access-Control-Allow-Headers "Authorization, Content-Type, Accept" ;
@@ -45,21 +44,62 @@ http {
45
44
add_header Access-Control-Max-Age 1728000 ;
46
45
return 200 ;
47
46
}
47
+ try_files $uri @django;
48
+ }
49
+
50
+ location @django {
51
+
52
+ etag off;
53
+ expires 0 ;
54
+ include uwsgi_params;
55
+ uwsgi_pass uwsgi://django:8000;
48
56
49
- client_max_body_size 15M ;
50
- client_body_buffer_size 128K ;
51
57
add_header Access-Control-Allow-Credentials false ;
52
58
add_header Access-Control-Allow-Headers "Content-Type, Accept, Authorization, Origin, User-Agent" ;
53
59
add_header Access-Control-Allow-Methods "GET, POST, PUT, PATCH, OPTIONS" ;
54
- proxy_set_header X-Forwarded-Protocol $scheme ;
55
- proxy_read_timeout 30 ;
60
+ }
61
+
62
+
63
+ location /geoserver {
64
+ etag off;
65
+ expires 0 ;
66
+ proxy_pass http://geoserver:8080/geoserver;
67
+
56
68
proxy_redirect off ;
57
69
proxy_set_header Host $host ;
58
70
proxy_set_header X-Real-IP $remote_addr ;
59
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for ;
60
- proxy_set_header X-Forwarded-Host $server_name ;
61
71
}
62
- }
63
-
72
+ etag on;
73
+ gzip on ;
74
+
75
+ client_max_body_size 100M ;
76
+ client_body_buffer_size 128K ;
77
+
78
+ proxy_connect_timeout 600 ;
79
+ proxy_send_timeout 600 ;
80
+ proxy_read_timeout 600 ;
81
+ send_timeout 600 ;
82
+ uwsgi_read_timeout 600 ;
83
+
84
+ expires 1d ;
85
+ gzip_disable "msie6" ;
86
+ gzip_comp_level 6 ;
87
+ gzip_min_length 1100 ;
88
+ gzip_buffers 16 8k ;
89
+ gzip_proxied any;
90
+ gzip_types
91
+ text/plain
92
+ text/css
93
+ text/js
94
+ text/xml
95
+ text/javascript
96
+ application/javascript
97
+ application/x-javascript
98
+ application/json
99
+ application/xml
100
+ application/rss+xml
101
+ image/svg+xml;
102
+
103
+ }
64
104
#include /etc/nginx/conf.d/*.conf;
65
105
}
0 commit comments