user nginx; worker_processes auto; pid /var/run/nginx.pid; error_log /dev/stdout info; events { worker_connections 1024; # Accept as many connections as possible. multi_accept on; } http { include /etc/nginx/mime.types; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /dev/stdout main; sendfile on; keepalive_timeout 65; gzip on; server { listen 443 ssl; # The max body size for proxied POST and PUT requests. # This is most commonly a problem for file uploads. client_max_body_size 20M; # Configure SSL Certification Location ssl_certificate /etc/nginx/certs/https-proxy.crt; ssl_certificate_key /etc/nginx/certs/https-proxy.key; # Activate SSL & Cipher algorithms. ssl_session_cache shared:SSL:10m; ssl_session_timeout 10m; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # ssl_ciphers HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4; # ssl_prefer_server_ciphers on; # Configure gzip compression for responses. gzip on; gzip_buffers 16 8k; gzip_comp_level 6; gzip_min_length 1000; gzip_proxied any; gzip_types text/css text/javascript text/plain text/xml application/javascript application/json application/hal+json application/x-javascript application/xml application/xml+rss; gzip_vary on; gzip_disable "MSIE [1-6]\.(?!.*SV1)"; location / { root /var/www/html/public; # The proxy will check from the root for files to meet a given # request before proxying along to the node service. try_files $uri @service; } location @service { if ($request_method = 'OPTIONS') { add_header 'Access-Control-Allow-Origin' "$http_origin"; add_header 'Access-Control-Allow-Credentials' 'true'; add_header 'Access-Control-Allow-Methods' 'GET,POST,OPTIONS,PUT,DELETE,PATCH'; add_header 'Access-Control-Max-Age' 1728000; add_header 'Content-Type' 'text/plain charset=UTF-8'; add_header 'Content-Length' 0; return 204; } proxy_set_header Host grass; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Host https-proxy; proxy_set_header X-Forwarded-Port 443; proxy_pass http://grass:8080; } } include /etc/nginx/conf.d/*.conf; }