server { listen 80; server_name ${SERVER_NAME} www.${SERVER_NAME}; return 301 https://$host$request_uri; } server { # Обрабатываться должны HTTPS/WSS соединения. add_header X-XSS-Protection "1; mode=block"; add_header Strict-Transport-Security "max-age=31536000; includeSubDomains"; add_header X-Frame-Options "DENY"; add_header X-Content-Type-Options nosniff; add_header Cache-Control "private, max-age=0, s-maxage=0, no-cache, no-store, must-revalidate, no-transform, proxy-revalidate"; listen 443 ssl; server_name ${SERVER_NAME}; keepalive_timeout 70; ssl_certificate /usr/share/nginx/ssl/server.crt; ssl_certificate_key /usr/share/nginx/ssl/server.key; location / { # Тут должен возвращаться index.html autoindex on; root /usr/share/nginx/html; try_files $uri $uri/ /index.html; proxy_cache off; ## # Gzip Settings ## gzip on; gzip_vary on; gzip_proxied any; gzip_comp_level 6; gzip_buffers 16 8k; gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript; } location /ws { # Тут прокси к webSocket серверу. proxy_pass http://${WS_HOST}:${WS_PORT}; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_cache off; } location /service/ { # Тут прокси к http серверу. proxy_pass http://${SERVER_HOST}:${SERVER_PORT}; proxy_cache off; } location /migration { # Тут прокси к http серверу. proxy_pass http://${SERVER_HOST}:${SERVER_PORT}; proxy_cache off; } }