upstream geocontrib_site { server geocontrib:5000; } server { listen 80; charset utf-8; server_name 127.0.0.1; client_max_body_size 4G; location /api { proxy_pass_header Set-Cookie; proxy_set_header X-NginX-Proxy true; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $host; proxy_read_timeout 300s; proxy_redirect off; proxy_pass http://geocontrib_site; } location /admin { proxy_pass_header Set-Cookie; proxy_set_header X-NginX-Proxy true; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $host; proxy_read_timeout 300s; proxy_redirect off; proxy_pass http://geocontrib_site; } location /static/ { alias /opt/geocontrib/static/; } location /media/ { alias /opt/geocontrib/media/; } location / { root /usr/share/nginx/html; index index.html; try_files $uri$args $uri/ /index.html; } }