# Define connection details for connecting to django running in # a docker container. upstream uwsgi { server uwsgi:8080; } upstream geoserver { server geoserver:8080; } server { # OTF gzip compression gzip on; gzip_min_length 860; gzip_comp_level 5; gzip_proxied expired no-cache no-store private auth; gzip_types text/plain application/xml application/x-javascript text/xml text/css application/json; gzip_disable “MSIE [1-6].(?!.*SV1)”; access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; # the port your site will be served on listen 8080; # the domain name it will serve for # server_name staging.foss4g-africa.org; charset utf-8; # max upload size, adjust to taste client_max_body_size 15M; # Django media location /media { # your Django project's media files - amend as required alias /home/web/media; expires 21d; # cache for 71 days } location /static { # your Django project's static files - amend as required alias /home/web/static; expires 21d; # cache for 21 days } location /api/geoserver/ { proxy_pass http://geoserver/geoserver/; } # Finally, send all non-media requests to the Django server. location / { uwsgi_pass uwsgi; # the uwsgi_params file you installed needs to be passed with each # request. # the uwsgi_params need to be passed with each uwsgi request uwsgi_param QUERY_STRING $query_string; uwsgi_param REQUEST_METHOD $request_method; uwsgi_param CONTENT_TYPE $content_type; uwsgi_param CONTENT_LENGTH $content_length; uwsgi_param REQUEST_URI $request_uri; uwsgi_param PATH_INFO $document_uri; uwsgi_param DOCUMENT_ROOT $document_root; uwsgi_param SERVER_PROTOCOL $server_protocol; uwsgi_param HTTPS $https if_not_empty; uwsgi_param REMOTE_ADDR $remote_addr; uwsgi_param REMOTE_PORT $remote_port; uwsgi_param SERVER_PORT $server_port; uwsgi_param SERVER_NAME $server_name; } }