user nginx; worker_processes 1; error_log /var/log/nginx/error.log warn; pid /var/run/nginx.pid; events { worker_connections 1024; } http { include /etc/nginx/mime.types; default_type application/octet-stream; log_format main '${DOLLAR}remote_addr - ${DOLLAR}remote_user [${DOLLAR}time_local] "${DOLLAR}request" ' '${DOLLAR}status ${DOLLAR}body_bytes_sent "${DOLLAR}http_referer" ' '"${DOLLAR}http_user_agent" "${DOLLAR}http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; sendfile on; #tcp_nopush on; keepalive_timeout 65; gzip on; gzip_types text/css application/javascript; server { listen 80 default_server; listen [::]:80 default_server; root /usr/share/nginx/html; index index.html index.htm index.nginx-debian.html; add_header "Access-Control-Allow-Origin" "*"; add_header "Access-Control-Allow-Methods" 'GET, POST, OPTIONS, PUT, DELETE'; add_header "Access-Control-Allow-Headers" 'X-Requested-With,Accept,Content-Type, Origin'; location / { try_files ${DOLLAR}uri ${DOLLAR}uri/ /index.html; } location /api { proxy_pass ${BACKEND_URL}; } } }