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

Commit

Permalink
Merge branch 'production'
Browse files Browse the repository at this point in the history
  • Loading branch information
francbartoli committed Jul 10, 2019
2 parents a49d28e + 50b31f7 commit 68086da
Showing 1 changed file with 51 additions and 11 deletions.
62 changes: 51 additions & 11 deletions nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ http {
'"$http_user_agent" "$http_x_forwarded_for"';

access_log /var/log/nginx/access.log main;
error_log /var/log/nginx/error.log;

sendfile on;
#tcp_nopush on;
Expand All @@ -31,11 +32,9 @@ http {
server{
listen 80;
index index.html index.htm;
root /usr/share/nginx/html;
root /mnt/volumes/statics/;

location /{
proxy_pass http://django:8000;

if ($request_method = OPTIONS) {
add_header Access-Control-Allow-Methods "GET, POST, PUT, PATCH, OPTIONS";
add_header Access-Control-Allow-Headers "Authorization, Content-Type, Accept";
Expand All @@ -45,21 +44,62 @@ http {
add_header Access-Control-Max-Age 1728000;
return 200;
}
try_files $uri @django;
}

location @django {

etag off;
expires 0;
include uwsgi_params;
uwsgi_pass uwsgi://django:8000;

client_max_body_size 15M;
client_body_buffer_size 128K;
add_header Access-Control-Allow-Credentials false;
add_header Access-Control-Allow-Headers "Content-Type, Accept, Authorization, Origin, User-Agent";
add_header Access-Control-Allow-Methods "GET, POST, PUT, PATCH, OPTIONS";
proxy_set_header X-Forwarded-Protocol $scheme;
proxy_read_timeout 30;
}


location /geoserver {
etag off;
expires 0;
proxy_pass http://geoserver:8080/geoserver;

proxy_redirect off;
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-Host $server_name;
}
}

etag on;
gzip on;

client_max_body_size 100M;
client_body_buffer_size 128K;

proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 600;
uwsgi_read_timeout 600;

expires 1d;
gzip_disable "msie6";
gzip_comp_level 6;
gzip_min_length 1100;
gzip_buffers 16 8k;
gzip_proxied any;
gzip_types
text/plain
text/css
text/js
text/xml
text/javascript
application/javascript
application/x-javascript
application/json
application/xml
application/rss+xml
image/svg+xml;

}
#include /etc/nginx/conf.d/*.conf;
}

0 comments on commit 68086da

Please sign in to comment.