default.conf.template 955 B

1234567891011121314151617181920212223242526272829303132
  1. server {
  2. listen 80 default_server;
  3. root /usr/share/nginx/html;
  4. index index.html;
  5. proxy_http_version 1.1;
  6. proxy_cache_bypass $http_upgrade;
  7. proxy_set_header Upgrade $http_upgrade;
  8. proxy_set_header Connection 'upgrade';
  9. proxy_set_header Host $host;
  10. proxy_set_header X-Real-IP $remote_addr;
  11. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  12. proxy_set_header X-Forwarded-Proto $scheme;
  13. server_name _;
  14. server_tokens off;
  15. location / {
  16. if ($http_user_agent ~* "baiduspider|twitterbot|facebookexternalhit|rogerbot|linkedinbot|embedly|quora link preview|showyoubot|outbrain|pinterest|slackbot|vkShare|W3C_Validator") {
  17. proxy_pass http://${META_SERVER_HOSTNAME};
  18. break;
  19. }
  20. try_files $uri /index.html;
  21. gzip on;
  22. gzip_proxied any;
  23. gzip_comp_level 4;
  24. gzip_types text/css application/javascript image/svg+xml;
  25. }
  26. }