Skip to content
This repository was archived by the owner on Oct 12, 2023. It is now read-only.

Commit 68086da

Browse files
committed
Merge branch 'production'
2 parents a49d28e + 50b31f7 commit 68086da

File tree

1 file changed

+51
-11
lines changed

1 file changed

+51
-11
lines changed

nginx.conf

Lines changed: 51 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ http {
1919
'"$http_user_agent" "$http_x_forwarded_for"';
2020

2121
access_log /var/log/nginx/access.log main;
22+
error_log /var/log/nginx/error.log;
2223

2324
sendfile on;
2425
#tcp_nopush on;
@@ -31,11 +32,9 @@ http {
3132
server{
3233
listen 80;
3334
index index.html index.htm;
34-
root /usr/share/nginx/html;
35+
root /mnt/volumes/statics/;
3536

3637
location /{
37-
proxy_pass http://django:8000;
38-
3938
if ($request_method = OPTIONS) {
4039
add_header Access-Control-Allow-Methods "GET, POST, PUT, PATCH, OPTIONS";
4140
add_header Access-Control-Allow-Headers "Authorization, Content-Type, Accept";
@@ -45,21 +44,62 @@ http {
4544
add_header Access-Control-Max-Age 1728000;
4645
return 200;
4746
}
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;
4856

49-
client_max_body_size 15M;
50-
client_body_buffer_size 128K;
5157
add_header Access-Control-Allow-Credentials false;
5258
add_header Access-Control-Allow-Headers "Content-Type, Accept, Authorization, Origin, User-Agent";
5359
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+
5668
proxy_redirect off;
5769
proxy_set_header Host $host;
5870
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;
6171
}
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+
}
64104
#include /etc/nginx/conf.d/*.conf;
65105
}

0 commit comments

Comments
 (0)